home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1994-10-19 | 35.9 KB | [ONLN/HLX2] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Fri Oct 14 08:46:45 1994, modified Wed Oct 19 09:58:51 1994, creator 'HLX2', type 'ONLN', 34327 bytes "PT28 Multiple Inheritance" , at 0x8697 2135 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
100%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [ONLN] |
macFileCreator | [HLX2] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 19 50 54 32 38 20 4d | 75 6c 74 69 70 6c 65 20 |..PT28 M|ultiple |
|00000010| 49 6e 68 65 72 69 74 61 | 6e 63 65 00 00 00 00 00 |Inherita|nce.....|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 4f 4e 4c 4e 48 4c 58 | 32 01 00 00 00 00 00 00 |.ONLNHLX|2.......|
|00000050| 00 00 00 00 00 86 17 00 | 00 08 57 aa c4 2e 35 aa |........|..W...5.|
|00000060| ca d6 9b 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 48 6b 00 00 |........|....Hk..|
|00000080| 50 54 20 32 38 20 2d 20 | 4d 75 6c 74 69 70 6c 65 |PT 28 - |Multiple|
|00000090| 20 49 6e 68 65 72 69 74 | 61 6e 63 65 20 61 6e 64 | Inherit|ance and|
|000000a0| 20 48 61 6e 64 6c 65 4f | 62 6a 65 63 74 73 0d 50 | HandleO|bjects.P|
|000000b0| 6c 61 74 66 6f 72 6d 73 | 20 26 20 54 6f 6f 6c 73 |latforms| & Tools|
|000000c0| 09 0d 57 72 69 74 74 65 | 6e 20 62 79 3a 09 4c 61 |..Writte|n by:.La|
|000000d0| 72 72 79 20 52 6f 73 65 | 6e 73 74 65 69 6e 09 41 |rry Rose|nstein.A|
|000000e0| 75 67 75 73 74 20 31 39 | 39 30 0d 54 68 69 73 20 |ugust 19|90.This |
|000000f0| 54 65 63 68 6e 69 63 61 | 6c 20 4e 6f 74 65 20 61 |Technica|l Note a|
|00000100| 6e 73 77 65 72 73 20 61 | 20 63 6f 6d 6d 6f 6e 20 |nswers a| common |
|00000110| 71 75 65 73 74 69 6f 6e | 20 61 62 6f 75 74 20 4d |question| about M|
|00000120| 50 57 20 43 2b 2b 3a 20 | 20 d2 57 68 79 20 64 6f |PW C++: | .Why do|
|00000130| 65 73 6e d5 74 20 48 61 | 6e 64 6c 65 4f 62 6a 65 |esn.t Ha|ndleObje|
|00000140| 63 74 20 73 75 70 70 6f | 72 74 20 6d 75 6c 74 69 |ct suppo|rt multi|
|00000150| 70 6c 65 20 69 6e 68 65 | 72 69 74 61 6e 63 65 3f |ple inhe|ritance?|
|00000160| d3 20 20 49 74 20 64 6f | 65 73 20 74 68 69 73 20 |. It do|es this |
|00000170| 62 79 20 67 69 76 69 6e | 67 20 61 20 62 72 69 65 |by givin|g a brie|
|00000180| 66 20 6f 76 65 72 76 69 | 65 77 20 6f 66 20 68 6f |f overvi|ew of ho|
|00000190| 77 20 6d 75 6c 74 69 70 | 6c 65 20 69 6e 68 65 72 |w multip|le inher|
|000001a0| 69 74 61 6e 63 65 20 69 | 73 20 69 6d 70 6c 65 6d |itance i|s implem|
|000001b0| 65 6e 74 65 64 20 69 6e | 20 4d 50 57 20 43 2b 2b |ented in| MPW C++|
|000001c0| 2e 0d 57 68 61 74 20 41 | 72 65 20 48 61 6e 64 6c |..What A|re Handl|
|000001d0| 65 4f 62 6a 65 63 74 73 | 20 41 6e 79 77 61 79 3f |eObjects| Anyway?|
|000001e0| 0d 4d 50 57 20 43 2b 2b | 20 63 6f 6e 74 61 69 6e |.MPW C++| contain|
|000001f0| 73 20 73 65 76 65 72 61 | 6c 20 65 78 74 65 6e 73 |s severa|l extens|
|00000200| 69 6f 6e 73 20 74 6f 20 | d2 73 74 61 6e 64 61 72 |ions to |.standar|
|00000210| 64 20 43 2b 2b d3 20 66 | 6f 72 20 73 75 70 70 6f |d C++. f|or suppo|
|00000220| 72 74 69 6e 67 20 4d 61 | 63 69 6e 74 6f 73 68 20 |rting Ma|cintosh |
|00000230| 70 72 6f 67 72 61 6d 6d | 69 6e 67 2e 20 20 4f 6e |programm|ing. On|
|00000240| 65 20 73 75 63 68 20 65 | 78 74 65 6e 73 69 6f 6e |e such e|xtension|
|00000250| 20 69 73 20 74 68 65 20 | 62 75 69 6c 74 2d 69 6e | is the |built-in|
|00000260| 20 63 6c 61 73 73 20 48 | 61 6e 64 6c 65 4f 62 6a | class H|andleObj|
|00000270| 65 63 74 2e 20 20 41 6e | 20 69 6e 73 74 61 6e 63 |ect. An| instanc|
|00000280| 65 20 6f 66 20 61 6e 79 | 20 63 6c 61 73 73 20 64 |e of any| class d|
|00000290| 65 73 63 65 6e 64 65 64 | 20 66 72 6f 6d 20 48 61 |escended| from Ha|
|000002a0| 6e 64 6c 65 4f 62 6a 65 | 63 74 20 69 73 20 61 6c |ndleObje|ct is al|
|000002b0| 6c 6f 63 61 74 65 64 20 | 61 73 20 61 20 68 61 6e |located |as a han|
|000002c0| 64 6c 65 20 69 6e 20 74 | 68 65 20 68 65 61 70 2e |dle in t|he heap.|
|000002d0| 20 20 59 6f 75 20 72 65 | 66 65 72 20 74 6f 20 6f | You re|fer to o|
|000002e0| 6e 65 20 6f 66 20 74 68 | 65 73 65 20 69 6e 73 74 |ne of th|ese inst|
|000002f0| 61 6e 63 65 73 20 61 73 | 20 69 66 20 69 74 20 77 |ances as| if it w|
|00000300| 65 72 65 20 61 20 73 69 | 6d 70 6c 65 20 70 6f 69 |ere a si|mple poi|
|00000310| 6e 74 65 72 3b 20 74 68 | 65 20 63 6f 6d 70 69 6c |nter; th|e compil|
|00000320| 65 72 20 74 61 6b 65 73 | 20 63 61 72 65 20 6f 66 |er takes| care of|
|00000330| 20 74 68 65 20 65 78 74 | 72 61 20 64 65 72 65 66 | the ext|ra deref|
|00000340| 65 72 65 6e 63 65 20 72 | 65 71 75 69 72 65 64 20 |erence r|equired |
|00000350| 62 65 63 61 75 73 65 20 | 74 68 65 20 6f 62 6a 65 |because |the obje|
|00000360| 63 74 20 69 73 20 72 65 | 61 6c 6c 79 20 61 20 68 |ct is re|ally a h|
|00000370| 61 6e 64 6c 65 2e 0d 41 | 20 48 61 6e 64 6c 65 4f |andle..A| HandleO|
|00000380| 62 6a 65 63 74 20 69 73 | 20 75 73 65 66 75 6c 20 |bject is| useful |
|00000390| 69 6e 20 4d 61 63 69 6e | 74 6f 73 68 20 70 72 6f |in Macin|tosh pro|
|000003a0| 67 72 61 6d 6d 69 6e 67 | 20 66 6f 72 20 74 68 65 |gramming| for the|
|000003b0| 20 73 61 6d 65 20 72 65 | 61 73 6f 6e 20 61 20 68 | same re|ason a h|
|000003c0| 61 6e 64 6c 65 20 69 73 | 20 75 73 65 66 75 6c 2e |andle is| useful.|
|000003d0| 20 20 54 68 65 20 75 73 | 65 20 6f 66 20 68 61 6e | The us|e of han|
|000003e0| 64 6c 65 73 20 68 65 6c | 70 73 20 70 72 65 76 65 |dles hel|ps preve|
|000003f0| 6e 74 20 68 65 61 70 20 | 66 72 61 67 6d 65 6e 74 |nt heap |fragment|
|00000400| 61 74 69 6f 6e 2e 20 20 | 54 68 65 20 6e 61 74 75 |ation. |The natu|
|00000410| 72 65 20 6f 66 20 48 61 | 6e 64 6c 65 4f 62 6a 65 |re of Ha|ndleObje|
|00000420| 63 74 20 69 6d 70 6f 73 | 65 73 20 73 6f 6d 65 20 |ct impos|es some |
|00000430| 72 65 73 74 72 69 63 74 | 69 6f 6e 73 20 6f 6e 20 |restrict|ions on |
|00000440| 68 6f 77 20 79 6f 75 20 | 63 61 6e 20 75 73 65 20 |how you |can use |
|00000450| 69 74 20 69 6e 20 61 20 | 70 72 6f 67 72 61 6d 2c |it in a |program,|
|00000460| 20 68 6f 77 65 76 65 72 | 2e 0d 46 69 72 73 74 2c | however|..First,|
|00000470| 20 73 69 6e 63 65 20 65 | 61 63 68 20 69 6e 73 74 | since e|ach inst|
|00000480| 61 6e 63 65 20 69 73 20 | 61 6c 6c 6f 63 61 74 65 |ance is |allocate|
|00000490| 64 20 61 73 20 61 20 68 | 61 6e 64 6c 65 2c 20 69 |d as a h|andle, i|
|000004a0| 74 20 66 6f 6c 6c 6f 77 | 73 20 74 68 61 74 20 61 |t follow|s that a|
|000004b0| 6c 6c 20 69 6e 73 74 61 | 6e 63 65 73 20 6d 75 73 |ll insta|nces mus|
|000004c0| 74 20 62 65 20 61 6c 6c | 6f 63 61 74 65 64 20 6f |t be all|ocated o|
|000004d0| 6e 20 74 68 65 20 68 65 | 61 70 2e 20 20 28 d2 4e |n the he|ap. (.N|
|000004e0| 61 74 69 76 65 d3 20 43 | 2b 2b 20 6f 62 6a 65 63 |ative. C|++ objec|
|000004f0| 74 73 20 63 61 6e 20 62 | 65 20 61 6c 6c 6f 63 61 |ts can b|e alloca|
|00000500| 74 65 64 20 6f 6e 20 74 | 68 65 20 73 74 61 63 6b |ted on t|he stack|
|00000510| 20 6f 72 20 69 6e 20 74 | 68 65 20 67 6c 6f 62 61 | or in t|he globa|
|00000520| 6c 20 73 70 61 63 65 20 | 61 73 20 77 65 6c 6c 2e |l space |as well.|
|00000530| 29 20 20 43 6f 6e 73 65 | 71 75 65 6e 74 6c 79 2c |) Conse|quently,|
|00000540| 20 79 6f 75 20 61 6c 77 | 61 79 73 20 64 65 63 6c | you alw|ays decl|
|00000550| 61 72 65 20 76 61 72 69 | 61 62 6c 65 73 2c 20 70 |are vari|ables, p|
|00000560| 61 72 61 6d 65 74 65 72 | 73 2c 20 65 74 63 2e 20 |arameter|s, etc. |
|00000570| 74 6f 20 62 65 20 70 6f | 69 6e 74 65 72 73 20 74 |to be po|inters t|
|00000580| 6f 20 74 68 65 20 63 6c | 61 73 73 2e 20 20 46 6f |o the cl|ass. Fo|
|00000590| 72 20 65 78 61 6d 70 6c | 65 3a 0d 20 20 20 20 63 |r exampl|e:. c|
|000005a0| 6c 61 73 73 20 54 53 61 | 6d 70 6c 65 3a 20 70 75 |lass TSa|mple: pu|
|000005b0| 62 6c 69 63 20 48 61 6e | 64 6c 65 4f 62 6a 65 63 |blic Han|dleObjec|
|000005c0| 74 20 7b 0d 20 20 20 20 | 70 75 62 6c 69 63 3a 0d |t {. |public:.|
|000005d0| 20 20 20 20 20 20 20 20 | c9 0d 20 20 20 20 20 20 | |.. |
|000005e0| 20 20 6c 6f 6e 67 20 20 | 20 20 66 44 61 74 61 3b | long | fData;|
|000005f0| 0d 20 20 20 20 7d 3b 0d | 20 20 20 20 54 53 61 6d |. };.| TSam|
|00000600| 70 6c 65 20 20 2a 61 53 | 61 6d 70 6c 65 49 6e 73 |ple *aS|ampleIns|
|00000610| 74 61 6e 63 65 3b 20 20 | 20 20 20 20 20 20 2f 2f |tance; | //|
|00000620| 20 4c 65 67 61 6c 0d 20 | 20 20 20 54 53 61 6d 70 | Legal. | TSamp|
|00000630| 6c 65 20 20 61 6e 6f 74 | 68 65 72 53 61 6d 70 6c |le anot|herSampl|
|00000640| 65 3b 20 20 20 20 20 20 | 20 20 20 20 20 2f 2f 20 |e; | // |
|00000650| 52 65 73 75 6c 74 73 20 | 69 6e 20 61 20 63 6f 6d |Results |in a com|
|00000660| 70 69 6c 65 2d 74 69 6d | 65 20 65 72 72 6f 72 0d |pile-tim|e error.|
|00000670| 54 68 65 20 65 72 72 6f | 72 20 6d 65 73 73 61 67 |The erro|r messag|
|00000680| 65 20 74 68 65 20 63 6f | 6d 70 69 6c 65 72 20 67 |e the co|mpiler g|
|00000690| 65 6e 65 72 61 74 65 73 | 20 69 6e 20 74 68 69 73 |enerates| in this|
|000006a0| 20 63 61 73 65 20 69 73 | 20 d2 43 61 6e d5 74 20 | case is| .Can.t |
|000006b0| 64 65 63 6c 61 72 65 20 | 61 20 68 61 6e 64 6c 65 |declare |a handle|
|000006c0| 2f 70 61 73 63 61 6c 20 | 6f 62 6a 65 63 74 3a 20 |/pascal |object: |
|000006d0| 61 6e 6f 74 68 65 72 53 | 61 6d 70 6c 65 2e d3 20 |anotherS|ample.. |
|000006e0| 20 41 74 20 66 69 72 73 | 74 20 74 68 69 73 20 6d | At firs|t this m|
|000006f0| 65 73 73 61 67 65 20 6d | 69 67 68 74 20 73 65 65 |essage m|ight see|
|00000700| 6d 20 73 74 72 61 6e 67 | 65 2c 20 62 65 63 61 75 |m strang|e, becau|
|00000710| 73 65 20 74 68 65 20 6c | 61 73 74 20 74 77 6f 20 |se the l|ast two |
|00000720| 6c 69 6e 65 73 20 69 6e | 20 74 68 69 73 20 63 6f |lines in| this co|
|00000730| 64 65 20 73 65 65 6d 20 | 74 6f 20 62 6f 74 68 20 |de seem |to both |
|00000740| 64 65 63 6c 61 72 65 20 | 6f 62 6a 65 63 74 73 2e |declare |objects.|
|00000750| 20 20 41 63 74 75 61 6c | 6c 79 2c 20 74 68 65 20 | Actual|ly, the |
|00000760| 66 69 72 73 74 20 64 65 | 63 6c 61 72 61 74 69 6f |first de|claratio|
|00000770| 6e 20 69 73 20 6f 66 20 | 61 20 70 6f 69 6e 74 65 |n is of |a pointe|
|00000780| 72 20 74 6f 20 61 6e 20 | 6f 62 6a 65 63 74 2c 20 |r to an |object, |
|00000790| 6e 6f 74 20 6f 66 20 74 | 68 65 20 6f 62 6a 65 63 |not of t|he objec|
|000007a0| 74 20 69 74 73 65 6c 66 | 2e 0d 54 68 65 20 73 65 |t itself|..The se|
|000007b0| 63 6f 6e 64 20 72 65 73 | 74 72 69 63 74 69 6f 6e |cond res|triction|
|000007c0| 20 69 73 20 74 68 61 74 | 20 79 6f 75 20 6d 75 73 | is that| you mus|
|000007d0| 74 20 66 6f 6c 6c 6f 77 | 20 74 68 65 20 75 73 75 |t follow| the usu|
|000007e0| 61 6c 20 72 75 6c 65 73 | 20 66 6f 72 20 6d 61 6e |al rules| for man|
|000007f0| 69 70 75 6c 61 74 69 6e | 67 20 68 61 6e 64 6c 65 |ipulatin|g handle|
|00000800| 73 2e 20 20 49 6e 20 70 | 61 72 74 69 63 75 6c 61 |s. In p|articula|
|00000810| 72 2c 20 79 6f 75 20 68 | 61 76 65 20 74 6f 20 62 |r, you h|ave to b|
|00000820| 65 20 63 61 72 65 66 75 | 6c 20 61 62 6f 75 74 20 |e carefu|l about |
|00000830| 63 72 65 61 74 69 6e 67 | 20 70 6f 69 6e 74 65 72 |creating| pointer|
|00000840| 73 20 74 6f 20 61 20 48 | 61 6e 64 6c 65 4f 62 6a |s to a H|andleObj|
|00000850| 65 63 74 20 69 6e 73 74 | 61 6e 63 65 20 76 61 72 |ect inst|ance var|
|00000860| 69 61 62 6c 65 2c 20 73 | 69 6e 63 65 20 74 68 65 |iable, s|ince the|
|00000870| 20 6f 62 6a 65 63 74 20 | 6d 69 67 68 74 20 6d 6f | object |might mo|
|00000880| 76 65 20 69 66 20 74 68 | 65 20 68 65 61 70 20 69 |ve if th|e heap i|
|00000890| 73 20 63 6f 6d 70 61 63 | 74 65 64 2e 20 20 49 66 |s compac|ted. If|
|000008a0| 20 79 6f 75 20 77 72 69 | 74 65 0d 20 20 20 20 6c | you wri|te. l|
|000008b0| 6f 6e 67 20 2a 78 20 3d | 20 26 20 28 61 53 61 6d |ong *x =| & (aSam|
|000008c0| 70 6c 65 49 6e 73 74 61 | 6e 63 65 20 2d 3e 20 66 |pleInsta|nce -> f|
|000008d0| 44 61 74 61 29 3b 0d 74 | 68 65 6e 20 78 20 62 65 |Data);.t|hen x be|
|000008e0| 63 6f 6d 65 73 20 69 6e | 76 61 6c 69 64 20 69 66 |comes in|valid if|
|000008f0| 20 74 68 65 20 6f 62 6a | 65 63 74 20 6d 6f 76 65 | the obj|ect move|
|00000900| 73 2e 20 20 54 68 65 20 | 73 6f 6c 75 74 69 6f 6e |s. The |solution|
|00000910| 20 69 6e 20 74 68 69 73 | 20 63 61 73 65 20 69 73 | in this| case is|
|00000920| 20 74 6f 20 6c 6f 63 6b | 20 74 68 65 20 6f 62 6a | to lock| the obj|
|00000930| 65 63 74 20 69 66 20 74 | 68 65 72 65 d5 73 20 61 |ect if t|here.s a|
|00000940| 20 70 6f 73 73 69 62 69 | 6c 69 74 79 20 6f 66 20 | possibi|lity of |
|00000950| 74 68 65 20 68 65 61 70 | 20 62 65 69 6e 67 20 63 |the heap| being c|
|00000960| 6f 6d 70 61 63 74 65 64 | 2e 20 20 49 6e 73 74 61 |ompacted|. Insta|
|00000970| 6e 63 65 73 20 6f 66 20 | 48 61 6e 64 6c 65 4f 62 |nces of |HandleOb|
|00000980| 6a 65 63 74 20 61 72 65 | 20 61 6c 6c 6f 63 61 74 |ject are| allocat|
|00000990| 65 64 20 77 69 74 68 20 | 61 20 63 61 6c 6c 20 74 |ed with |a call t|
|000009a0| 6f 20 5f 4e 65 77 48 61 | 6e 64 6c 65 2c 20 73 6f |o _NewHa|ndle, so|
|000009b0| 20 79 6f 75 20 63 61 6e | 20 75 73 65 20 5f 48 4c | you can| use _HL|
|000009c0| 6f 63 6b 20 61 6e 64 20 | 5f 48 55 6e 6c 6f 63 6b |ock and |_HUnlock|
|000009d0| 20 74 6f 20 6c 6f 63 6b | 20 61 6e 64 20 75 6e 6c | to lock| and unl|
|000009e0| 6f 63 6b 20 74 68 65 20 | 6f 62 6a 65 63 74 2e 0d |ock the |object..|
|000009f0| 54 68 65 20 74 68 69 72 | 64 20 72 65 73 74 72 69 |The thir|d restri|
|00000a00| 63 74 69 6f 6e 20 69 73 | 20 74 68 61 74 20 79 6f |ction is| that yo|
|00000a10| 75 20 63 61 6e 6e 6f 74 | 20 75 73 65 20 6d 75 6c |u cannot| use mul|
|00000a20| 74 69 70 6c 65 20 69 6e | 68 65 72 69 74 61 6e 63 |tiple in|heritanc|
|00000a30| 65 20 77 69 74 68 20 61 | 20 48 61 6e 64 6c 65 4f |e with a| HandleO|
|00000a40| 62 6a 65 63 74 2e 20 20 | 54 68 65 20 72 65 61 73 |bject. |The reas|
|00000a50| 6f 6e 20 62 65 68 69 6e | 64 20 74 68 69 73 20 72 |on behin|d this r|
|00000a60| 65 73 74 72 69 63 74 69 | 6f 6e 20 69 73 20 6e 6f |estricti|on is no|
|00000a70| 74 20 65 76 69 64 65 6e | 74 2c 20 68 6f 77 65 76 |t eviden|t, howev|
|00000a80| 65 72 2e 20 20 54 6f 20 | 75 6e 64 65 72 73 74 61 |er. To |understa|
|00000a90| 6e 64 20 74 68 65 20 72 | 65 61 73 6f 6e 2c 20 79 |nd the r|eason, y|
|00000aa0| 6f 75 20 6d 75 73 74 20 | 6c 6f 6f 6b 20 61 74 20 |ou must |look at |
|00000ab0| 74 68 65 20 69 6d 70 6c | 65 6d 65 6e 74 61 74 69 |the impl|ementati|
|00000ac0| 6f 6e 20 6f 66 20 6d 75 | 6c 74 69 70 6c 65 20 69 |on of mu|ltiple i|
|00000ad0| 6e 68 65 72 69 74 61 6e | 63 65 2e 0d 49 6d 70 6c |nheritan|ce..Impl|
|00000ae0| 65 6d 65 6e 74 69 6e 67 | 20 4d 75 6c 74 69 70 6c |ementing| Multipl|
|00000af0| 65 20 49 6e 68 65 72 69 | 74 61 6e 63 65 0d 54 6f |e Inheri|tance.To|
|00000b00| 20 75 6e 64 65 72 73 74 | 61 6e 64 20 68 6f 77 20 | underst|and how |
|00000b10| 6d 75 6c 74 69 70 6c 65 | 20 69 6e 68 65 72 69 74 |multiple| inherit|
|00000b20| 61 6e 63 65 20 69 73 20 | 69 6d 70 6c 65 6d 65 6e |ance is |implemen|
|00000b30| 74 65 64 2c 20 6f 6e 65 | 20 6e 65 65 64 73 20 61 |ted, one| needs a|
|00000b40| 20 73 69 6d 70 6c 65 20 | 65 78 61 6d 70 6c 65 2e | simple |example.|
|00000b50| 20 53 75 70 70 6f 73 65 | 20 79 6f 75 20 64 65 66 | Suppose| you def|
|00000b60| 69 6e 65 20 74 77 6f 20 | 63 6c 61 73 73 65 73 20 |ine two |classes |
|00000b70| 61 73 20 66 6f 6c 6c 6f | 77 73 3a 0d 20 20 20 20 |as follo|ws:. |
|00000b80| 63 6c 61 73 73 20 54 42 | 61 73 65 41 20 7b 0d 20 |class TB|aseA {. |
|00000b90| 20 20 20 70 75 62 6c 69 | 63 3a 0d 20 20 20 20 20 | publi|c:. |
|00000ba0| 20 20 20 76 69 72 74 75 | 61 6c 20 76 6f 69 64 20 | virtu|al void |
|00000bb0| 20 53 65 74 56 61 72 41 | 28 6c 6f 6e 67 20 6e 65 | SetVarA|(long ne|
|00000bc0| 77 56 61 6c 75 65 29 3b | 0d 20 20 20 20 20 20 20 |wValue);|. |
|00000bd0| 20 20 20 20 20 20 20 20 | 20 6c 6f 6e 67 20 20 66 | | long f|
|00000be0| 56 61 72 41 3b 0d 20 20 | 20 20 20 20 20 20 c9 0d |VarA;. | ..|
|00000bf0| 20 20 20 20 7d 3b 0d 20 | 20 20 20 63 6c 61 73 73 | };. | class|
|00000c00| 20 54 42 61 73 65 42 20 | 7b 0d 20 20 20 20 70 75 | TBaseB |{. pu|
|00000c10| 62 6c 69 63 3a 0d 20 20 | 20 20 20 20 20 20 76 69 |blic:. | vi|
|00000c20| 72 74 75 61 6c 20 76 6f | 69 64 20 20 53 65 74 56 |rtual vo|id SetV|
|00000c30| 61 72 42 28 6c 6f 6e 67 | 20 6e 65 77 56 61 6c 75 |arB(long| newValu|
|00000c40| 65 29 3b 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |e);. | |
|00000c50| 20 20 20 20 6c 6f 6e 67 | 20 20 66 56 61 72 42 3b | long| fVarB;|
|00000c60| 0d 20 20 20 20 20 20 20 | 20 c9 0d 20 20 20 20 7d |. | .. }|
|00000c70| 3b 0d 49 66 20 79 6f 75 | 20 77 65 72 65 20 74 6f |;.If you| were to|
|00000c80| 20 6c 6f 6f 6b 20 61 74 | 20 69 6e 73 74 61 6e 63 | look at| instanc|
|00000c90| 65 73 20 6f 66 20 74 68 | 65 73 65 20 63 6c 61 73 |es of th|ese clas|
|00000ca0| 73 65 73 20 28 73 65 65 | 20 46 69 67 75 72 65 20 |ses (see| Figure |
|00000cb0| 31 29 2c 20 79 6f 75 20 | 77 6f 75 6c 64 20 66 69 |1), you |would fi|
|00000cc0| 6e 64 20 74 68 61 74 20 | 69 6e 20 65 61 63 68 20 |nd that |in each |
|00000cd0| 63 61 73 65 20 74 68 65 | 20 69 6e 73 74 61 6e 63 |case the| instanc|
|00000ce0| 65 20 73 74 6f 72 61 67 | 65 20 77 6f 75 6c 64 20 |e storag|e would |
|00000cf0| 63 6f 6e 74 61 69 6e 20 | 66 6f 75 72 20 62 79 74 |contain |four byt|
|00000d00| 65 73 20 66 6f 72 20 74 | 68 65 20 43 2b 2b 20 76 |es for t|he C++ v|
|00000d10| 69 72 74 75 61 6c 20 74 | 61 62 6c 65 20 28 76 74 |irtual t|able (vt|
|00000d20| 61 62 6c 65 29 20 61 6e | 64 20 66 6f 75 72 20 62 |able) an|d four b|
|00000d30| 79 74 65 73 20 66 6f 72 | 20 74 68 65 20 69 6e 73 |ytes for| the ins|
|00000d40| 74 61 6e 63 65 20 76 61 | 72 69 61 62 6c 65 2e 20 |tance va|riable. |
|00000d50| 20 41 6e 79 20 63 6f 64 | 65 20 74 68 61 74 20 61 | Any cod|e that a|
|00000d60| 63 63 65 73 73 65 73 20 | 74 68 65 20 69 6e 73 74 |ccesses |the inst|
|00000d70| 61 6e 63 65 20 76 61 72 | 69 61 62 6c 65 20 28 66 |ance var|iable (f|
|00000d80| 6f 72 20 65 78 61 6d 70 | 6c 65 20 54 42 61 73 65 |or examp|le TBase|
|00000d90| 42 3a 3a 53 65 74 56 61 | 72 42 29 20 77 6f 75 6c |B::SetVa|rB) woul|
|00000da0| 64 20 64 6f 20 73 6f 20 | 75 73 69 6e 67 20 61 20 |d do so |using a |
|00000db0| 66 69 78 65 64 20 6f 66 | 66 73 65 74 20 66 72 6f |fixed of|fset fro|
|00000dc0| 6d 20 74 68 65 20 73 74 | 61 72 74 20 6f 66 20 74 |m the st|art of t|
|00000dd0| 68 65 20 6f 62 6a 65 63 | 74 2e 20 20 28 49 6e 20 |he objec|t. (In |
|00000de0| 74 68 69 73 20 70 61 72 | 74 69 63 75 6c 61 72 20 |this par|ticular |
|00000df0| 76 65 72 73 69 6f 6e 20 | 6f 66 20 43 2b 2b 2c 20 |version |of C++, |
|00000e00| 74 68 69 73 20 6f 66 66 | 73 65 74 20 77 61 73 20 |this off|set was |
|00000e10| 30 3b 20 79 6f 75 72 20 | 6f 66 66 73 65 74 20 6d |0; your |offset m|
|00000e20| 61 79 20 76 61 72 79 2e | 29 0d 46 69 67 75 72 65 |ay vary.|).Figure|
|00000e30| 20 31 d0 4c 61 79 6f 75 | 74 20 6f 66 20 54 42 61 | 1.Layou|t of TBa|
|00000e40| 73 65 41 20 61 6e 64 20 | 54 42 61 73 65 42 20 49 |seA and |TBaseB I|
|00000e50| 6e 73 74 61 6e 63 65 73 | 0d 4e 6f 77 20 73 75 70 |nstances|.Now sup|
|00000e60| 70 6f 73 65 20 79 6f 75 | 20 64 65 66 69 6e 65 20 |pose you| define |
|00000e70| 61 6e 6f 74 68 65 72 20 | 63 6c 61 73 73 3a 0d 20 |another |class:. |
|00000e80| 20 20 20 63 6c 61 73 73 | 20 54 44 65 72 69 76 65 | class| TDerive|
|00000e90| 64 3a 20 70 75 62 6c 69 | 63 20 54 42 61 73 65 41 |d: publi|c TBaseA|
|00000ea0| 2c 20 70 75 62 6c 69 63 | 20 54 42 61 73 65 42 20 |, public| TBaseB |
|00000eb0| 7b 0d 20 20 20 20 70 75 | 62 6c 69 63 3a 0d 20 20 |{. pu|blic:. |
|00000ec0| 20 20 20 20 20 20 76 69 | 72 74 75 61 6c 20 76 6f | vi|rtual vo|
|00000ed0| 69 64 20 20 53 65 74 44 | 65 72 69 76 65 64 56 61 |id SetD|erivedVa|
|00000ee0| 72 28 6c 6f 6e 67 20 6e | 65 77 56 61 6c 75 65 29 |r(long n|ewValue)|
|00000ef0| 3b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |;. | |
|00000f00| 20 20 6c 6f 6e 67 20 20 | 66 44 65 72 69 76 65 64 | long |fDerived|
|00000f10| 56 61 72 3b 0d 20 20 20 | 20 20 20 20 20 c9 0d 20 |Var;. | .. |
|00000f20| 20 20 20 7d 3b 0d 49 6e | 20 74 68 69 73 20 63 61 | };.In| this ca|
|00000f30| 73 65 2c 20 61 6e 20 69 | 6e 73 74 61 6e 63 65 20 |se, an i|nstance |
|00000f40| 6f 66 20 54 44 65 72 69 | 76 65 64 20 68 61 73 20 |of TDeri|ved has |
|00000f50| 74 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 6c 61 |the foll|owing la|
|00000f60| 79 6f 75 74 3a 0d 46 69 | 67 75 72 65 20 32 d0 4c |yout:.Fi|gure 2.L|
|00000f70| 61 79 6f 75 74 20 6f 66 | 20 54 44 65 72 69 76 65 |ayout of| TDerive|
|00000f80| 64 20 49 6e 73 74 61 6e | 63 65 0d 54 68 69 73 20 |d Instan|ce.This |
|00000f90| 69 73 20 77 68 61 74 20 | 79 6f 75 20 77 6f 75 6c |is what |you woul|
|00000fa0| 64 20 65 78 70 65 63 74 | 2e 20 20 54 44 65 72 69 |d expect|. TDeri|
|00000fb0| 76 65 64 20 69 6e 68 65 | 72 69 74 73 20 66 72 6f |ved inhe|rits fro|
|00000fc0| 6d 20 62 6f 74 68 20 54 | 42 61 73 65 41 20 61 6e |m both T|BaseA an|
|00000fd0| 64 20 54 42 61 73 65 42 | 2c 20 61 6e 64 20 74 68 |d TBaseB|, and th|
|00000fe0| 65 72 65 66 6f 72 65 20 | 69 6e 73 74 61 6e 63 65 |erefore |instance|
|00000ff0| 73 20 6f 66 20 54 44 65 | 72 69 76 65 64 20 63 6f |s of TDe|rived co|
|00001000| 6e 74 61 69 6e 20 61 20 | 70 61 72 74 20 74 68 61 |ntain a |part tha|
|00001010| 74 20 69 73 20 61 20 54 | 42 61 73 65 41 20 61 6e |t is a T|BaseA an|
|00001020| 64 20 61 20 70 61 72 74 | 20 74 68 61 74 20 69 73 |d a part| that is|
|00001030| 20 61 20 54 42 61 73 65 | 42 2e 20 20 49 6e 20 61 | a TBase|B. In a|
|00001040| 64 64 69 74 69 6f 6e 2c | 20 74 68 65 20 76 69 72 |ddition,| the vir|
|00001050| 74 75 61 6c 20 74 61 62 | 6c 65 20 76 74 61 62 6c |tual tab|le vtabl|
|00001060| 65 44 65 72 69 76 65 64 | 20 69 6e 63 6c 75 64 65 |eDerived| include|
|00001070| 73 20 74 68 65 20 74 61 | 62 6c 65 73 20 66 6f 72 |s the ta|bles for|
|00001080| 20 62 6f 74 68 20 54 42 | 61 73 65 41 20 61 6e 64 | both TB|aseA and|
|00001090| 20 54 44 65 72 69 76 65 | 64 2e 0d 54 44 65 72 69 | TDerive|d..TDeri|
|000010a0| 76 65 64 20 61 6c 73 6f | 20 69 6e 68 65 72 69 74 |ved also| inherit|
|000010b0| 73 20 74 68 65 20 6d 65 | 74 68 6f 64 73 20 64 65 |s the me|thods de|
|000010c0| 66 69 6e 65 64 20 69 6e | 20 54 42 61 73 65 41 20 |fined in| TBaseA |
|000010d0| 61 6e 64 20 54 42 61 73 | 65 42 2e 20 20 53 75 70 |and TBas|eB. Sup|
|000010e0| 70 6f 73 65 20 79 6f 75 | 20 77 61 6e 74 65 64 20 |pose you| wanted |
|000010f0| 74 6f 20 63 61 6c 6c 20 | 74 68 65 20 6d 65 74 68 |to call |the meth|
|00001100| 6f 64 20 53 65 74 56 61 | 72 42 2c 20 75 73 69 6e |od SetVa|rB, usin|
|00001110| 67 20 61 20 54 44 65 72 | 69 76 65 64 20 6f 62 6a |g a TDer|ived obj|
|00001120| 65 63 74 2e 20 20 54 68 | 65 20 63 6f 64 65 20 66 |ect. Th|e code f|
|00001130| 6f 72 20 53 65 74 56 61 | 72 42 20 69 73 20 65 78 |or SetVa|rB is ex|
|00001140| 70 65 63 74 69 6e 67 20 | 74 6f 20 62 65 20 70 61 |pecting |to be pa|
|00001150| 73 73 65 64 20 61 20 70 | 6f 69 6e 74 65 72 20 74 |ssed a p|ointer t|
|00001160| 6f 20 61 20 54 42 61 73 | 65 42 20 6f 62 6a 65 63 |o a TBas|eB objec|
|00001170| 74 20 28 61 6c 6c 20 6d | 65 74 68 6f 64 73 20 61 |t (all m|ethods a|
|00001180| 72 65 20 70 61 73 73 65 | 64 20 61 20 70 6f 69 6e |re passe|d a poin|
|00001190| 74 65 72 20 74 6f 20 61 | 6e 20 61 70 70 72 6f 70 |ter to a|n approp|
|000011a0| 72 69 61 74 65 20 6f 62 | 6a 65 63 74 20 61 73 20 |riate ob|ject as |
|000011b0| 61 6e 20 69 6d 70 6c 69 | 63 69 74 20 70 61 72 61 |an impli|cit para|
|000011c0| 6d 65 74 65 72 29 2c 20 | 61 6e 64 20 72 65 66 65 |meter), |and refe|
|000011d0| 72 73 20 74 6f 20 66 56 | 61 72 42 20 62 79 20 61 |rs to fV|arB by a|
|000011e0| 20 66 69 78 65 64 20 6f | 66 66 73 65 74 20 66 72 | fixed o|ffset fr|
|000011f0| 6f 6d 20 74 68 61 74 20 | 70 6f 69 6e 74 65 72 2e |om that |pointer.|
|00001200| 20 20 54 68 65 72 65 66 | 6f 72 65 2c 20 74 6f 20 | Theref|ore, to |
|00001210| 63 61 6c 6c 20 53 65 74 | 56 61 72 42 20 75 73 69 |call Set|VarB usi|
|00001220| 6e 67 20 61 20 54 44 65 | 72 69 76 65 64 20 6f 62 |ng a TDe|rived ob|
|00001230| 6a 65 63 74 2c 20 43 2b | 2b 20 70 61 73 73 65 73 |ject, C+|+ passes|
|00001240| 20 61 20 70 6f 69 6e 74 | 65 72 20 74 6f 20 74 68 | a point|er to th|
|00001250| 65 20 6d 69 64 64 6c 65 | 20 6f 66 20 74 68 65 20 |e middle| of the |
|00001260| 6f 62 6a 65 63 74 3b 20 | 73 70 65 63 69 66 69 63 |object; |specific|
|00001270| 61 6c 6c 79 20 69 74 20 | 70 61 73 73 65 73 20 61 |ally it |passes a|
|00001280| 20 70 6f 69 6e 74 65 72 | 20 74 6f 20 74 68 65 20 | pointer| to the |
|00001290| 70 61 72 74 20 6f 66 20 | 74 68 65 20 6f 62 6a 65 |part of |the obje|
|000012a0| 63 74 20 74 68 61 74 20 | 72 65 70 72 65 73 65 6e |ct that |represen|
|000012b0| 74 73 20 61 20 54 42 61 | 73 65 42 2e 0d 54 68 69 |ts a TBa|seB..Thi|
|000012c0| 73 20 67 69 76 65 73 20 | 79 6f 75 20 61 20 76 65 |s gives |you a ve|
|000012d0| 72 79 20 62 61 73 69 63 | 20 69 64 65 61 20 6f 66 |ry basic| idea of|
|000012e0| 20 68 6f 77 20 43 2b 2b | 20 69 6d 70 6c 65 6d 65 | how C++| impleme|
|000012f0| 6e 74 73 20 6d 75 6c 74 | 69 70 6c 65 20 69 6e 68 |nts mult|iple inh|
|00001300| 65 72 69 74 61 6e 63 65 | 2e 20 20 46 6f 72 20 6d |eritance|. For m|
|00001310| 6f 72 65 20 64 65 74 61 | 69 6c 73 2c 20 72 65 61 |ore deta|ils, rea|
|00001320| 64 20 d2 4d 75 6c 74 69 | 70 6c 65 20 49 6e 68 65 |d .Multi|ple Inhe|
|00001330| 72 69 74 61 6e 63 65 20 | 66 6f 72 20 43 2b 2b d3 |ritance |for C++.|
|00001340| 20 62 79 20 42 6a 61 72 | 6e 65 20 53 74 72 6f 75 | by Bjar|ne Strou|
|00001350| 73 74 72 75 70 20 69 6e | 20 50 72 6f 63 65 65 64 |strup in| Proceed|
|00001360| 69 6e 67 73 20 45 55 55 | 47 20 53 70 72 69 6e 67 |ings EUU|G Spring|
|00001370| 20 31 39 38 37 20 43 6f | 6e 66 65 72 65 6e 63 65 | 1987 Co|nference|
|00001380| 2c 20 48 65 6c 73 69 6e | 6b 69 2e 0d 53 6f 20 57 |, Helsin|ki..So W|
|00001390| 68 61 74 20 41 62 6f 75 | 74 20 48 61 6e 64 6c 65 |hat Abou|t Handle|
|000013a0| 4f 62 6a 65 63 74 73 3f | 0d 54 68 65 20 6e 65 78 |Objects?|.The nex|
|000013b0| 74 20 71 75 65 73 74 69 | 6f 6e 20 69 73 20 68 6f |t questi|on is ho|
|000013c0| 77 20 74 68 69 73 20 69 | 6d 70 6c 65 6d 65 6e 74 |w this i|mplement|
|000013d0| 61 74 69 6f 6e 20 69 6d | 70 6f 73 65 73 20 61 20 |ation im|poses a |
|000013e0| 72 65 73 74 72 69 63 74 | 69 6f 6e 20 6f 6e 20 61 |restrict|ion on a|
|000013f0| 20 48 61 6e 64 6c 65 4f | 62 6a 65 63 74 2e 20 20 | HandleO|bject. |
|00001400| 54 68 65 20 61 6e 73 77 | 65 72 20 69 73 20 73 69 |The answ|er is si|
|00001410| 6d 70 6c 65 2e 20 20 45 | 61 63 68 20 6d 65 74 68 |mple. E|ach meth|
|00001420| 6f 64 20 6f 66 20 61 20 | 48 61 6e 64 6c 65 4f 62 |od of a |HandleOb|
|00001430| 6a 65 63 74 20 63 6c 61 | 73 73 20 65 78 70 65 63 |ject cla|ss expec|
|00001440| 74 73 20 74 6f 20 62 65 | 20 70 61 73 73 65 64 20 |ts to be| passed |
|00001450| 61 20 68 61 6e 64 6c 65 | 20 74 6f 20 74 68 65 20 |a handle| to the |
|00001460| 6f 62 6a 65 63 74 2c 20 | 69 6e 73 74 65 61 64 20 |object, |instead |
|00001470| 6f 66 20 61 20 70 6f 69 | 6e 74 65 72 2e 20 20 42 |of a poi|nter. B|
|00001480| 75 74 20 77 68 65 6e 20 | 6d 75 6c 74 69 70 6c 65 |ut when |multiple|
|00001490| 20 69 6e 68 65 72 69 74 | 61 6e 63 65 20 69 73 20 | inherit|ance is |
|000014a0| 75 73 65 64 2c 20 74 68 | 65 20 63 6f 6d 70 69 6c |used, th|e compil|
|000014b0| 65 72 20 73 6f 6d 65 74 | 69 6d 65 73 20 68 61 73 |er somet|imes has|
|000014c0| 20 74 6f 20 70 61 73 73 | 20 61 20 70 6f 69 6e 74 | to pass| a point|
|000014d0| 65 72 20 74 6f 20 74 68 | 65 20 6d 69 64 64 6c 65 |er to th|e middle|
|000014e0| 20 6f 66 20 74 68 65 20 | 6f 62 6a 65 63 74 2e 20 | of the |object. |
|000014f0| 20 49 74 20 69 73 20 6e | 6f 74 20 70 6f 73 73 69 | It is n|ot possi|
|00001500| 62 6c 65 20 74 6f 20 63 | 72 65 61 74 65 20 61 20 |ble to c|reate a |
|00001510| 76 61 6c 69 64 20 68 61 | 6e 64 6c 65 20 74 68 61 |valid ha|ndle tha|
|00001520| 74 20 72 65 66 65 72 73 | 20 74 6f 20 74 68 65 20 |t refers| to the |
|00001530| 6d 69 64 64 6c 65 20 6f | 66 20 61 6e 6f 74 68 65 |middle o|f anothe|
|00001540| 72 20 68 61 6e 64 6c 65 | 2e 20 20 28 43 72 65 61 |r handle|. (Crea|
|00001550| 74 69 6e 67 20 61 20 66 | 61 6b 65 20 68 61 6e 64 |ting a f|ake hand|
|00001560| 6c 65 20 69 73 20 61 20 | 63 6f 6d 70 61 74 69 62 |le is a |compatib|
|00001570| 69 6c 69 74 79 20 72 69 | 73 6b 3b 20 62 65 73 69 |ility ri|sk; besi|
|00001580| 64 65 73 2c 20 74 68 65 | 20 70 6f 69 6e 74 65 72 |des, the| pointer|
|00001590| 20 69 6e 74 6f 20 74 68 | 65 20 6d 69 64 64 6c 65 | into th|e middle|
|000015a0| 20 6f 66 20 74 68 65 20 | 68 61 6e 64 6c 65 20 77 | of the |handle w|
|000015b0| 6f 75 6c 64 20 62 65 20 | 69 6e 76 61 6c 69 64 20 |ould be |invalid |
|000015c0| 69 66 20 74 68 65 20 68 | 61 6e 64 6c 65 20 69 73 |if the h|andle is|
|000015d0| 20 6d 6f 76 65 64 2e 29 | 0d 44 65 73 69 67 6e 69 | moved.)|.Designi|
|000015e0| 6e 67 20 61 20 6e 65 77 | 20 69 6d 70 6c 65 6d 65 |ng a new| impleme|
|000015f0| 6e 74 61 74 69 6f 6e 20 | 6f 66 20 6d 75 6c 74 69 |ntation |of multi|
|00001600| 70 6c 65 20 69 6e 68 65 | 72 69 74 61 6e 63 65 20 |ple inhe|ritance |
|00001610| 74 68 61 74 20 69 73 20 | 63 6f 6d 70 61 74 69 62 |that is |compatib|
|00001620| 6c 65 20 77 69 74 68 20 | 61 20 48 61 6e 64 6c 65 |le with |a Handle|
|00001630| 4f 62 6a 65 63 74 2c 20 | 61 73 20 77 65 6c 6c 20 |Object, |as well |
|00001640| 61 73 20 74 68 65 20 72 | 65 73 74 20 6f 66 20 43 |as the r|est of C|
|00001650| 2b 2b 2c 20 69 73 20 61 | 20 62 69 67 20 75 6e 64 |++, is a| big und|
|00001660| 65 72 74 61 6b 69 6e 67 | 2e 20 20 46 6f 72 20 74 |ertaking|. For t|
|00001670| 68 61 74 20 72 65 61 73 | 6f 6e 2c 20 69 74 20 69 |hat reas|on, it i|
|00001680| 73 20 75 6e 6c 69 6b 65 | 6c 79 20 74 68 61 74 20 |s unlike|ly that |
|00001690| 74 68 69 73 20 72 65 73 | 74 72 69 63 74 69 6f 6e |this res|triction|
|000016a0| 20 77 69 6c 6c 20 64 69 | 73 61 70 70 65 61 72 20 | will di|sappear |
|000016b0| 69 6e 20 74 68 65 20 66 | 75 74 75 72 65 2e 20 20 |in the f|uture. |
|000016c0| 54 68 65 72 65 20 61 72 | 65 2c 20 68 6f 77 65 76 |There ar|e, howev|
|000016d0| 65 72 2c 20 74 77 6f 20 | 61 6c 74 65 72 6e 61 74 |er, two |alternat|
|000016e0| 69 76 65 73 20 74 6f 20 | 63 6f 6e 73 69 64 65 72 |ives to |consider|
|000016f0| 3a 0d 44 61 6d 6e 20 74 | 68 65 20 46 72 61 67 6d |:.Damn t|he Fragm|
|00001700| 65 6e 74 61 74 69 6f 6e | 2c 20 46 75 6c 6c 20 53 |entation|, Full S|
|00001710| 70 65 65 64 20 41 68 65 | 61 64 0d 54 68 65 20 6d |peed Ahe|ad.The m|
|00001720| 61 69 6e 20 72 65 61 73 | 6f 6e 20 74 6f 20 75 73 |ain reas|on to us|
|00001730| 65 20 61 20 48 61 6e 64 | 6c 65 4f 62 6a 65 63 74 |e a Hand|leObject|
|00001740| 20 69 73 20 74 6f 20 72 | 65 64 75 63 65 20 74 68 | is to r|educe th|
|00001750| 65 20 63 68 61 6e 63 65 | 20 6f 66 20 66 72 61 67 |e chance| of frag|
|00001760| 6d 65 6e 74 61 74 69 6f | 6e 20 74 68 61 74 20 77 |mentatio|n that w|
|00001770| 6f 75 6c 64 20 72 65 73 | 75 6c 74 20 66 72 6f 6d |ould res|ult from|
|00001780| 20 75 73 69 6e 67 20 61 | 20 6e 6f 6e 2d 72 65 6c | using a| non-rel|
|00001790| 6f 63 61 74 61 62 6c 65 | 20 62 6c 6f 63 6b 2e 20 |ocatable| block. |
|000017a0| 20 49 6e 20 61 20 66 65 | 77 20 61 70 70 6c 69 63 | In a fe|w applic|
|000017b0| 61 74 69 6f 6e 73 2c 20 | 68 6f 77 65 76 65 72 2c |ations, |however,|
|000017c0| 20 74 68 65 20 6d 65 6d | 6f 72 79 20 61 6c 6c 6f | the mem|ory allo|
|000017d0| 63 61 74 69 6f 6e 20 70 | 61 74 74 65 72 6e 73 20 |cation p|atterns |
|000017e0| 61 72 65 20 76 65 72 79 | 20 70 72 65 64 69 63 74 |are very| predict|
|000017f0| 61 62 6c 65 2c 20 61 6e | 64 20 66 72 61 67 6d 65 |able, an|d fragme|
|00001800| 6e 74 61 74 69 6f 6e 20 | 6d 69 67 68 74 20 6e 6f |ntation |might no|
|00001810| 74 20 62 65 20 61 6e 20 | 69 73 73 75 65 2e 20 20 |t be an |issue. |
|00001820| 49 6e 20 74 68 6f 73 65 | 20 63 61 73 65 73 2c 20 |In those| cases, |
|00001830| 79 6f 75 20 63 61 6e 20 | 75 73 65 20 d2 6e 61 74 |you can |use .nat|
|00001840| 69 76 65 d3 20 43 2b 2b | 20 63 6c 61 73 73 65 73 |ive. C++| classes|
|00001850| 2e 20 20 28 44 6f 6e d5 | 74 20 75 73 65 20 74 68 |. (Don.|t use th|
|00001860| 65 20 61 72 67 75 6d 65 | 6e 74 20 74 68 61 74 20 |e argume|nt that |
|00001870| 38 20 4d 62 20 6d 61 63 | 68 69 6e 65 73 20 61 72 |8 Mb mac|hines ar|
|00001880| 65 20 63 6f 6d 6d 6f 6e | 2c 20 61 6e 64 20 76 69 |e common|, and vi|
|00001890| 72 74 75 61 6c 20 6d 65 | 6d 6f 72 79 20 69 73 20 |rtual me|mory is |
|000018a0| 68 65 72 65 20 74 6f 20 | 73 74 61 79 20 73 6f 20 |here to |stay so |
|000018b0| 66 72 61 67 6d 65 6e 74 | 61 74 69 6f 6e 20 69 73 |fragment|ation is|
|000018c0| 6e d5 74 20 61 6e 20 69 | 73 73 75 65 20 61 74 20 |n.t an i|ssue at |
|000018d0| 61 6c 6c 2e 20 20 44 61 | 74 61 20 61 6c 77 61 79 |all. Da|ta alway|
|000018e0| 73 20 65 78 70 61 6e 64 | 73 20 74 6f 20 66 69 6c |s expand|s to fil|
|000018f0| 6c 20 74 68 65 20 61 76 | 61 69 6c 61 62 6c 65 20 |l the av|ailable |
|00001900| 6d 65 6d 6f 72 79 20 73 | 70 61 63 65 2c 20 72 65 |memory s|pace, re|
|00001910| 61 6c 20 6f 72 20 76 69 | 72 74 75 61 6c 2e 29 0d |al or vi|rtual.).|
|00001920| 49 66 20 79 6f 75 20 61 | 64 6f 70 74 20 74 68 69 |If you a|dopt thi|
|00001930| 73 20 61 70 70 72 6f 61 | 63 68 2c 20 79 6f 75 20 |s approa|ch, you |
|00001940| 73 68 6f 75 6c 64 20 72 | 65 61 64 20 74 68 65 20 |should r|ead the |
|00001950| 61 72 74 69 63 6c 65 20 | d2 55 73 69 6e 67 20 43 |article |.Using C|
|00001960| 2b 2b 20 4f 62 6a 65 63 | 74 73 20 69 6e 20 61 20 |++ Objec|ts in a |
|00001970| 48 61 6e 64 6c 65 2d 42 | 61 73 65 64 20 57 6f 72 |Handle-B|ased Wor|
|00001980| 6c 64 d3 20 62 79 20 41 | 6e 64 72 65 77 20 53 68 |ld. by A|ndrew Sh|
|00001990| 65 62 61 6e 6f 77 20 69 | 6e 20 49 73 73 75 65 20 |ebanow i|n Issue |
|000019a0| 32 20 6f 66 20 64 20 65 | 20 76 20 65 20 6c 20 6f |2 of d e| v e l o|
|000019b0| 20 70 2c 20 41 70 72 69 | 6c 20 31 39 39 30 2e 20 | p, Apri|l 1990. |
|000019c0| 20 54 68 69 73 20 61 72 | 74 69 63 6c 65 20 64 65 | This ar|ticle de|
|000019d0| 73 63 72 69 62 65 73 20 | 68 6f 77 20 79 6f 75 20 |scribes |how you |
|000019e0| 63 61 6e 20 75 73 65 20 | 6e 61 74 69 76 65 20 43 |can use |native C|
|000019f0| 2b 2b 20 6f 62 6a 65 63 | 74 73 20 61 6e 64 20 6d |++ objec|ts and m|
|00001a00| 69 6e 69 6d 69 7a 65 20 | 68 65 61 70 20 66 72 61 |inimize |heap fra|
|00001a10| 67 6d 65 6e 74 61 74 69 | 6f 6e 2c 20 62 79 20 6f |gmentati|on, by o|
|00001a20| 76 65 72 72 69 64 69 6e | 67 20 74 68 65 20 77 61 |verridin|g the wa|
|00001a30| 79 20 43 2b 2b 20 6e 6f | 72 6d 61 6c 6c 79 20 61 |y C++ no|rmally a|
|00001a40| 6c 6c 6f 63 61 74 65 73 | 20 6f 62 6a 65 63 74 73 |llocates| objects|
|00001a50| 2e 20 20 54 68 65 20 73 | 61 6d 65 20 74 65 63 68 |. The s|ame tech|
|00001a60| 6e 69 71 75 65 73 20 63 | 61 6e 20 62 65 20 75 73 |niques c|an be us|
|00001a70| 65 64 20 74 6f 20 63 75 | 73 74 6f 6d 69 7a 65 20 |ed to cu|stomize |
|00001a80| 74 68 65 20 77 61 79 20 | 79 6f 75 72 20 70 72 6f |the way |your pro|
|00001a90| 67 72 61 6d 20 61 6c 6c | 6f 63 61 74 65 73 20 63 |gram all|ocates c|
|00001aa0| 65 72 74 61 69 6e 20 6f | 62 6a 65 63 74 73 2e 0d |ertain o|bjects..|
|00001ab0| d2 44 6f 63 74 6f 72 2c | 20 49 74 20 48 75 72 74 |.Doctor,| It Hurt|
|00001ac0| 73 20 57 68 65 6e 20 49 | 20 44 6f 20 54 68 61 74 |s When I| Do That|
|00001ad0| c9 d3 0d 54 68 65 20 6f | 74 68 65 72 20 61 6c 74 |...The o|ther alt|
|00001ae0| 65 72 6e 61 74 69 76 65 | 20 69 73 20 74 6f 20 67 |ernative| is to g|
|00001af0| 69 76 65 20 75 70 20 6d | 75 6c 74 69 70 6c 65 20 |ive up m|ultiple |
|00001b00| 69 6e 68 65 72 69 74 61 | 6e 63 65 2e 20 20 49 6e |inherita|nce. In|
|00001b10| 20 6d 6f 73 74 20 63 61 | 73 65 73 2c 20 74 68 69 | most ca|ses, thi|
|00001b20| 73 20 69 73 6e d5 74 20 | 61 73 20 64 69 66 66 69 |s isn.t |as diffi|
|00001b30| 63 75 6c 74 20 61 73 20 | 69 74 20 73 6f 75 6e 64 |cult as |it sound|
|00001b40| 73 2e 20 20 54 68 65 20 | 74 79 70 69 63 61 6c 20 |s. The |typical |
|00001b50| 77 61 79 20 79 6f 75 20 | 77 6f 75 6c 64 20 64 6f |way you |would do|
|00001b60| 20 74 68 69 73 20 69 73 | 20 77 69 74 68 20 61 20 | this is| with a |
|00001b70| 66 6f 72 6d 20 6f 66 20 | 64 65 6c 65 67 61 74 69 |form of |delegati|
|00001b80| 6f 6e 2e 20 20 46 6f 72 | 20 65 78 61 6d 70 6c 65 |on. For| example|
|00001b90| 2c 20 79 6f 75 20 63 6f | 75 6c 64 20 72 65 77 72 |, you co|uld rewr|
|00001ba0| 69 74 65 20 74 68 65 20 | 63 6c 61 73 73 20 54 44 |ite the |class TD|
|00001bb0| 65 72 69 76 65 64 20 61 | 73 3a 0d 20 20 20 20 63 |erived a|s:. c|
|00001bc0| 6c 61 73 73 20 54 53 69 | 6e 67 6c 65 44 65 72 69 |lass TSi|ngleDeri|
|00001bd0| 76 65 64 3a 20 70 75 62 | 6c 69 63 20 54 42 61 73 |ved: pub|lic TBas|
|00001be0| 65 41 20 7b 0d 20 20 20 | 20 70 75 62 6c 69 63 3a |eA {. | public:|
|00001bf0| 0d 20 20 20 20 20 20 20 | 20 76 69 72 74 75 61 6c |. | virtual|
|00001c00| 20 76 6f 69 64 20 20 20 | 53 65 74 44 65 72 69 76 | void |SetDeriv|
|00001c10| 65 64 56 61 72 28 6c 6f | 6e 67 20 6e 65 77 56 61 |edVar(lo|ng newVa|
|00001c20| 6c 75 65 29 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |lue);. | |
|00001c30| 20 20 20 20 20 20 76 6f | 69 64 20 20 20 53 65 74 | vo|id Set|
|00001c40| 42 61 73 65 42 28 6c 6f | 6e 67 20 6e 65 77 56 61 |BaseB(lo|ng newVa|
|00001c50| 6c 75 65 29 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |lue);. | |
|00001c60| 20 20 20 20 20 20 6c 6f | 6e 67 20 20 20 66 44 65 | lo|ng fDe|
|00001c70| 72 69 76 65 64 56 61 72 | 3b 0d 20 20 20 20 20 20 |rivedVar|;. |
|00001c80| 20 20 20 20 20 20 20 20 | 20 20 54 42 61 73 65 42 | | TBaseB|
|00001c90| 20 66 42 61 73 65 42 50 | 61 72 74 3b 0d 20 20 20 | fBaseBP|art;. |
|00001ca0| 20 20 20 20 20 c9 0d 20 | 20 20 20 7d 3b 0d 49 6e | .. | };.In|
|00001cb0| 20 74 68 69 73 20 63 61 | 73 65 20 54 53 69 6e 67 | this ca|se TSing|
|00001cc0| 6c 65 44 65 72 69 76 65 | 64 20 69 6e 68 65 72 69 |leDerive|d inheri|
|00001cd0| 74 73 20 6f 6e 6c 79 20 | 66 72 6f 6d 20 54 42 61 |ts only |from TBa|
|00001ce0| 73 65 41 2c 20 62 75 74 | 20 69 6e 63 6c 75 64 65 |seA, but| include|
|00001cf0| 73 20 61 6e 20 69 6e 73 | 74 61 6e 63 65 20 6f 66 |s an ins|tance of|
|00001d00| 20 54 42 61 73 65 42 20 | 61 73 20 61 6e 20 69 6e | TBaseB |as an in|
|00001d10| 73 74 61 6e 63 65 20 76 | 61 72 69 61 62 6c 65 2e |stance v|ariable.|
|00001d20| 20 20 49 74 20 61 6c 73 | 6f 20 69 6d 70 6c 65 6d | It als|o implem|
|00001d30| 65 6e 74 73 20 74 68 65 | 20 6d 65 74 68 6f 64 20 |ents the| method |
|00001d40| 53 65 74 42 61 73 65 42 | 20 74 6f 20 63 61 6c 6c |SetBaseB| to call|
|00001d50| 20 74 68 65 20 6d 65 74 | 68 6f 64 20 62 79 20 74 | the met|hod by t|
|00001d60| 68 65 20 73 61 6d 65 20 | 6e 61 6d 65 20 69 6e 20 |he same |name in |
|00001d70| 74 68 65 20 54 42 61 73 | 65 42 20 63 6c 61 73 73 |the TBas|eB class|
|00001d80| 2e 20 20 28 49 6e 20 65 | 66 66 65 63 74 2c 20 54 |. (In e|ffect, T|
|00001d90| 53 69 6e 67 6c 65 44 65 | 72 69 76 65 64 20 64 65 |SingleDe|rived de|
|00001da0| 6c 65 67 61 74 65 73 20 | 70 61 72 74 20 6f 66 20 |legates |part of |
|00001db0| 69 74 73 20 69 6d 70 6c | 65 6d 65 6e 74 61 74 69 |its impl|ementati|
|00001dc0| 6f 6e 20 74 6f 20 54 42 | 61 73 65 42 2e 29 20 20 |on to TB|aseB.) |
|00001dd0| 54 68 65 20 61 64 76 61 | 6e 74 61 67 65 20 6f 66 |The adva|ntage of|
|00001de0| 20 74 68 69 73 20 61 70 | 70 72 6f 61 63 68 20 69 | this ap|proach i|
|00001df0| 73 20 74 68 61 74 20 69 | 74 20 72 65 71 75 69 72 |s that i|t requir|
|00001e00| 65 73 20 6f 6e 6c 79 20 | 73 69 6e 67 6c 65 20 69 |es only |single i|
|00001e10| 6e 68 65 72 69 74 61 6e | 63 65 2c 20 79 65 74 20 |nheritan|ce, yet |
|00001e20| 79 6f 75 20 63 61 6e 20 | 73 74 69 6c 6c 20 72 65 |you can |still re|
|00001e30| 75 73 65 20 74 68 65 20 | 69 6d 70 6c 65 6d 65 6e |use the |implemen|
|00001e40| 74 61 74 69 6f 6e 20 6f | 66 20 54 42 61 73 65 42 |tation o|f TBaseB|
|00001e50| 2e 0d 54 68 65 20 64 69 | 73 61 64 76 61 6e 74 61 |..The di|sadvanta|
|00001e60| 67 65 73 20 61 72 65 20 | 74 68 61 74 20 54 53 69 |ges are |that TSi|
|00001e70| 6e 67 6c 65 44 65 72 69 | 76 65 64 20 69 73 20 6e |ngleDeri|ved is n|
|00001e80| 6f 74 20 61 20 73 75 62 | 74 79 70 65 20 6f 66 20 |ot a sub|type of |
|00001e90| 54 42 61 73 65 42 2c 20 | 77 68 69 63 68 20 6d 65 |TBaseB, |which me|
|00001ea0| 61 6e 73 20 74 68 61 74 | 20 61 6e 20 69 6e 73 74 |ans that| an inst|
|00001eb0| 61 6e 63 65 20 6f 66 20 | 54 53 69 6e 67 6c 65 44 |ance of |TSingleD|
|00001ec0| 65 72 69 76 65 64 20 63 | 61 6e 6e 6f 74 20 62 65 |erived c|annot be|
|00001ed0| 20 75 73 65 64 20 69 6e | 20 61 20 73 69 74 75 61 | used in| a situa|
|00001ee0| 74 69 6f 6e 20 74 68 61 | 74 20 72 65 71 75 69 72 |tion tha|t requir|
|00001ef0| 65 73 20 61 20 54 42 61 | 73 65 42 2e 20 20 41 6c |es a TBa|seB. Al|
|00001f00| 73 6f 2c 20 54 53 69 6e | 67 6c 65 44 65 72 69 76 |so, TSin|gleDeriv|
|00001f10| 65 64 20 68 61 73 20 74 | 6f 20 64 65 66 69 6e 65 |ed has t|o define|
|00001f20| 20 61 20 6d 65 74 68 6f | 64 20 74 68 61 74 20 63 | a metho|d that c|
|00001f30| 6f 72 72 65 73 70 6f 6e | 64 73 20 74 6f 20 65 61 |orrespon|ds to ea|
|00001f40| 63 68 20 6d 65 74 68 6f | 64 20 69 6e 20 54 42 61 |ch metho|d in TBa|
|00001f50| 73 65 42 2e 20 20 28 59 | 6f 75 20 63 61 6e 2c 20 |seB. (Y|ou can, |
|00001f60| 68 6f 77 65 76 65 72 2c | 20 64 65 66 69 6e 65 20 |however,| define |
|00001f70| 74 68 65 73 65 20 66 75 | 6e 63 74 69 6f 6e 73 20 |these fu|nctions |
|00001f80| 61 73 20 69 6e 6c 69 6e | 65 20 61 6e 64 20 6e 6f |as inlin|e and no|
|00001f90| 6e 2d 76 69 72 74 75 61 | 6c 2c 20 77 68 69 63 68 |n-virtua|l, which|
|00001fa0| 20 65 6c 69 6d 69 6e 61 | 74 65 73 20 61 6e 79 20 | elimina|tes any |
|00001fb0| 72 75 6e 2d 74 69 6d 65 | 20 6f 76 65 72 68 65 61 |run-time| overhea|
|00001fc0| 64 2e 29 0d 42 79 20 54 | 68 65 20 57 61 79 c9 0d |d.).By T|he Way..|
|00001fd0| 59 6f 75 20 73 68 6f 75 | 6c 64 20 72 65 61 6c 69 |You shou|ld reali|
|00001fe0| 7a 65 20 74 68 61 74 20 | 74 68 65 20 6d 75 6c 74 |ze that |the mult|
|00001ff0| 69 70 6c 65 20 69 6e 68 | 65 72 69 74 61 6e 63 65 |iple inh|eritance|
|00002000| 20 69 6d 70 6c 65 6d 65 | 6e 74 61 74 69 6f 6e 20 | impleme|ntation |
|00002010| 70 72 65 76 69 6f 75 73 | 6c 79 20 64 65 73 63 72 |previous|ly descr|
|00002020| 69 62 65 64 20 63 6f 73 | 74 73 20 73 6f 6d 65 20 |ibed cos|ts some |
|00002030| 65 78 74 72 61 20 73 70 | 61 63 65 2c 20 63 6f 6d |extra sp|ace, com|
|00002040| 70 61 72 65 64 20 74 6f | 20 61 20 73 69 6d 70 6c |pared to| a simpl|
|00002050| 65 72 20 69 6d 70 6c 65 | 6d 65 6e 74 61 74 69 6f |er imple|mentatio|
|00002060| 6e 20 74 68 61 74 20 64 | 6f 65 73 20 6e 6f 74 20 |n that d|oes not |
|00002070| 73 75 70 70 6f 72 74 20 | 6d 75 6c 74 69 70 6c 65 |support |multiple|
|00002080| 20 69 6e 68 65 72 69 74 | 61 6e 63 65 20 28 65 2e | inherit|ance (e.|
|00002090| 67 2e 2c 20 74 68 65 20 | 69 6d 70 6c 65 6d 65 6e |g., the |implemen|
|000020a0| 74 61 74 69 6f 6e 20 75 | 73 65 64 20 66 6f 72 20 |tation u|sed for |
|000020b0| 61 20 48 61 6e 64 6c 65 | 4f 62 6a 65 63 74 29 2e |a Handle|Object).|
|000020c0| 20 20 45 61 63 68 20 76 | 74 61 62 6c 65 20 69 73 | Each v|table is|
|000020d0| 20 74 77 69 63 65 20 61 | 73 20 6c 61 72 67 65 2c | twice a|s large,|
|000020e0| 20 61 6e 64 20 65 61 63 | 68 20 6d 65 74 68 6f 64 | and eac|h method|
|000020f0| 20 63 61 6c 6c 20 74 61 | 6b 65 73 20 61 62 6f 75 | call ta|kes abou|
|00002100| 74 20 32 34 20 62 79 74 | 65 73 2c 20 63 6f 6d 70 |t 24 byt|es, comp|
|00002110| 61 72 65 64 20 74 6f 20 | 31 34 2e 20 20 54 68 69 |ared to |14. Thi|
|00002120| 73 20 69 73 20 74 72 75 | 65 20 65 76 65 6e 20 69 |s is tru|e even i|
|00002130| 66 20 79 6f 75 20 64 6f | 20 6e 6f 74 20 74 61 6b |f you do| not tak|
|00002140| 65 20 61 64 76 61 6e 74 | 61 67 65 20 6f 66 20 6d |e advant|age of m|
|00002150| 75 6c 74 69 70 6c 65 20 | 69 6e 68 65 72 69 74 61 |ultiple |inherita|
|00002160| 6e 63 65 2e 20 20 46 6f | 72 20 74 68 69 73 20 72 |nce. Fo|r this r|
|00002170| 65 61 73 6f 6e 2c 20 4d | 50 57 20 43 2b 2b 20 61 |eason, M|PW C++ a|
|00002180| 6c 73 6f 20 63 6f 6e 74 | 61 69 6e 73 20 61 20 62 |lso cont|ains a b|
|00002190| 75 69 6c 74 20 69 6e 20 | 63 6c 61 73 73 20 63 61 |uilt in |class ca|
|000021a0| 6c 6c 65 64 20 53 69 6e | 67 6c 65 4f 62 6a 65 63 |lled Sin|gleObjec|
|000021b0| 74 2c 20 77 68 6f 73 65 | 20 69 6e 73 74 61 6e 63 |t, whose| instanc|
|000021c0| 65 73 20 61 72 65 20 61 | 6c 6c 6f 63 61 74 65 64 |es are a|llocated|
|000021d0| 20 69 6e 20 74 68 65 20 | 73 61 6d 65 20 77 61 79 | in the |same way|
|000021e0| 20 61 73 20 6e 6f 72 6d | 61 6c 20 43 2b 2b 20 69 | as norm|al C++ i|
|000021f0| 6e 73 74 61 6e 63 65 2c | 20 62 75 74 20 77 68 69 |nstance,| but whi|
|00002200| 63 68 20 6f 6e 6c 79 20 | 73 75 70 70 6f 72 74 73 |ch only |supports|
|00002210| 20 73 69 6e 67 6c 65 20 | 69 6e 68 65 72 69 74 61 | single |inherita|
|00002220| 6e 63 65 2e 20 20 28 42 | 79 20 74 68 65 20 77 61 |nce. (B|y the wa|
|00002230| 79 2c 20 74 68 65 20 74 | 68 69 72 64 20 63 6c 61 |y, the t|hird cla|
|00002240| 73 73 20 62 75 69 6c 74 | 20 69 6e 74 6f 20 4d 50 |ss built| into MP|
|00002250| 57 20 43 2b 2b 2c 20 50 | 61 73 63 61 6c 4f 62 6a |W C++, P|ascalObj|
|00002260| 65 63 74 2c 20 75 73 65 | 73 20 4f 62 6a 65 63 74 |ect, use|s Object|
|00002270| 20 50 61 73 63 61 6c d5 | 73 20 72 75 6e 2d 74 69 | Pascal.|s run-ti|
|00002280| 6d 65 20 69 6d 70 6c 65 | 6d 65 6e 74 61 74 69 6f |me imple|mentatio|
|00002290| 6e 2c 20 77 68 69 63 68 | 20 74 61 6b 65 73 20 74 |n, which| takes t|
|000022a0| 68 65 20 6c 65 61 73 74 | 20 61 6d 6f 75 6e 74 20 |he least| amount |
|000022b0| 6f 66 20 73 70 61 63 65 | 2c 20 62 75 74 20 74 68 |of space|, but th|
|000022c0| 65 20 6d 6f 73 74 20 65 | 78 65 63 75 74 69 6f 6e |e most e|xecution|
|000022d0| 20 74 69 6d 65 2e 29 0d | 43 6f 6e 63 6c 75 73 69 | time.).|Conclusi|
|000022e0| 6f 6e 0d 59 6f 75 20 63 | 61 6e 6e 6f 74 20 75 73 |on.You c|annot us|
|000022f0| 65 20 61 20 48 61 6e 64 | 6c 65 4f 62 6a 65 63 74 |e a Hand|leObject|
|00002300| 20 77 69 74 68 20 6d 75 | 6c 74 69 70 6c 65 20 69 | with mu|ltiple i|
|00002310| 6e 68 65 72 69 74 61 6e | 63 65 2c 20 62 65 63 61 |nheritan|ce, beca|
|00002320| 75 73 65 20 6f 66 20 74 | 68 65 20 77 61 79 20 6d |use of t|he way m|
|00002330| 75 6c 74 69 70 6c 65 20 | 69 6e 68 65 72 69 74 61 |ultiple |inherita|
|00002340| 6e 63 65 20 69 73 20 69 | 6d 70 6c 65 6d 65 6e 74 |nce is i|mplement|
|00002350| 65 64 20 69 6e 20 4d 50 | 57 20 43 2b 2b 2e 20 20 |ed in MP|W C++. |
|00002360| 59 6f 75 72 20 61 6c 74 | 65 72 6e 61 74 69 76 65 |Your alt|ernative|
|00002370| 73 20 61 72 65 20 74 6f | 20 67 69 76 65 20 75 70 |s are to| give up|
|00002380| 20 6f 6e 65 20 6f 72 20 | 74 68 65 20 6f 74 68 65 | one or |the othe|
|00002390| 72 2e 20 20 59 6f 75 20 | 63 61 6e 20 65 69 74 68 |r. You |can eith|
|000023a0| 65 72 20 75 73 65 20 6e | 61 74 69 76 65 20 43 2b |er use n|ative C+|
|000023b0| 2b 20 6f 62 6a 65 63 74 | 73 20 61 6e 64 20 6c 65 |+ object|s and le|
|000023c0| 74 20 74 68 65 20 6f 62 | 6a 65 63 74 73 20 66 61 |t the ob|jects fa|
|000023d0| 6c 6c 20 77 68 65 72 65 | 20 74 68 65 79 20 6d 61 |ll where| they ma|
|000023e0| 79 2c 20 6f 72 20 67 69 | 76 65 20 75 70 20 6d 75 |y, or gi|ve up mu|
|000023f0| 6c 74 69 70 6c 65 20 69 | 6e 68 65 72 69 74 61 6e |ltiple i|nheritan|
|00002400| 63 65 20 61 6e 64 20 75 | 73 65 20 61 20 66 6f 72 |ce and u|se a for|
|00002410| 6d 20 6f 66 20 64 65 6c | 65 67 61 74 69 6f 6e 2e |m of del|egation.|
|00002420| 0d 46 75 72 74 68 65 72 | 20 52 65 66 65 72 65 6e |.Further| Referen|
|00002430| 63 65 3a 0d a5 09 4d 50 | 57 20 43 2b 2b 20 52 65 |ce:...MP|W C++ Re|
|00002440| 66 65 72 65 6e 63 65 20 | 4d 61 6e 75 61 6c 0d a5 |ference |Manual..|
|00002450| 09 d2 55 73 69 6e 67 20 | 43 2b 2b 20 4f 62 6a 65 |..Using |C++ Obje|
|00002460| 63 74 73 20 69 6e 20 61 | 20 48 61 6e 64 6c 65 2d |cts in a| Handle-|
|00002470| 42 61 73 65 64 20 57 6f | 72 6c 64 2c d3 20 41 6e |Based Wo|rld,. An|
|00002480| 64 72 65 77 20 53 68 65 | 62 61 6e 6f 77 2c 20 64 |drew She|banow, d|
|00002490| 20 65 20 76 20 65 20 6c | 20 6f 20 70 2c 20 49 73 | e v e l| o p, Is|
|000024a0| 73 75 65 20 32 2c 20 41 | 70 72 69 6c 20 31 39 39 |sue 2, A|pril 199|
|000024b0| 30 2e 0d a5 09 d2 4d 75 | 6c 74 69 70 6c 65 20 49 |0.....Mu|ltiple I|
|000024c0| 6e 68 65 72 69 74 61 6e | 63 65 20 66 6f 72 20 43 |nheritan|ce for C|
|000024d0| 2b 2b 2c d3 20 42 6a 61 | 72 6e 65 20 53 74 72 6f |++,. Bja|rne Stro|
|000024e0| 75 73 74 72 75 70 2c 20 | 50 72 6f 63 65 65 64 69 |ustrup, |Proceedi|
|000024f0| 6e 67 73 20 45 55 55 47 | 20 53 70 72 69 6e 67 20 |ngs EUUG| Spring |
|00002500| 31 39 38 37 20 43 6f 6e | 66 65 72 65 6e 63 65 2c |1987 Con|ference,|
|00002510| 20 48 65 6c 73 69 6e 6b | 69 2e 0d 16 c6 00 00 00 | Helsink|i.......|
|00002520| 00 03 48 02 52 00 11 02 | ff 0c 00 ff ff ff ff 00 |..H.R...|........|
|00002530| 00 00 00 00 00 00 00 02 | 52 00 00 03 48 00 00 00 |........|R...H...|
|00002540| 00 00 00 00 a1 00 64 00 | 0c 57 4f 52 44 00 00 00 |......d.|.WORD...|
|00002550| 00 00 53 01 ca 00 a0 00 | 8c 00 a1 00 64 00 0c 57 |..S.....|....d..W|
|00002560| 4f 52 44 00 00 00 00 00 | 52 01 c9 00 a0 00 82 00 |ORD.....|R.......|
|00002570| 1e 00 01 00 0a 00 2f 00 | 5a 00 81 02 23 00 07 00 |....../.|Z...#...|
|00002580| 00 00 00 00 08 00 0a 00 | 09 30 49 88 3a b5 9c f0 |........|.0I.:...|
|00002590| 39 00 22 00 7b 02 1a 00 | 00 00 09 ff ff ff ff ff |9.".{...|........|
|000025a0| ff ff ff 00 23 00 00 00 | a0 00 c4 00 a1 00 64 00 |....#...|......d.|
|000025b0| 0a 4f 4e 4c 4e 00 66 00 | 00 01 fe 00 a0 00 8c 00 |.ONLN.f.|........|
|000025c0| a1 00 64 00 31 64 72 77 | 32 00 02 01 c9 00 2d 01 |..d.1drw|2.....-.|
|000025d0| e1 01 5f 00 00 80 00 00 | 00 00 00 00 00 00 00 00 |.._.....|........|
|000025e0| 00 00 00 00 00 00 00 ff | ff ff ff ff ff 00 01 00 |........|........|
|000025f0| 00 01 8f 00 00 00 00 00 | a1 00 96 00 0c 01 00 00 |........|........|
|00002600| 00 02 78 00 00 00 00 00 | 00 00 a1 00 64 00 10 64 |..x.....|....d..d|
|00002610| 72 77 32 00 3a 00 05 00 | 00 00 00 00 01 00 00 00 |rw2.:...|........|
|00002620| a1 00 64 00 0e 64 72 77 | 32 00 3a 00 02 00 24 00 |..d..drw|2.:...$.|
|00002630| 00 00 00 00 a1 00 64 00 | 34 64 72 77 32 00 3a 00 |......d.|4drw2.:.|
|00002640| 01 00 03 01 00 00 18 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002650| 00 00 01 00 01 00 01 00 | 01 00 00 00 00 00 00 00 |........|........|
|00002660| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 a1 00 |........|........|
|00002670| 9a 00 08 ff fa 00 00 00 | 97 40 00 00 a0 00 98 00 |........|.@......|
|00002680| 2c 00 08 00 14 05 54 69 | 6d 65 73 00 03 00 14 00 |,.....Ti|mes.....|
|00002690| 04 01 00 00 0d 00 18 00 | 2e 00 04 00 00 01 00 00 |........|........|
|000026a0| 10 57 49 51 6b 57 49 51 | 6b 00 2b 5d 42 13 4e 65 |.WIQkWIQ|k.+]B.Ne|
|000026b0| 77 20 54 65 63 68 6e 69 | 63 61 6c 20 4e 6f 74 65 |w Techni|cal Note|
|000026c0| 73 00 a0 00 99 00 a1 00 | 64 00 08 64 72 77 32 00 |s.......|d..drw2.|
|000026d0| 3a 00 04 00 a1 14 e3 00 | 02 00 01 00 a0 00 97 00 |:.......|........|
|000026e0| a1 00 64 00 31 64 72 77 | 32 00 02 02 06 01 65 02 |..d.1drw|2.....e.|
|000026f0| 19 01 f4 00 00 80 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002700| 00 00 00 00 00 00 00 ff | ff ff ff ff ff 00 01 00 |........|........|
|00002710| 00 01 50 00 00 00 00 00 | a1 00 96 00 0c 01 00 00 |..P.....|........|
|00002720| 00 02 78 00 00 00 00 00 | 00 00 a1 00 64 00 10 64 |..x.....|....d..d|
|00002730| 72 77 32 00 3a 00 05 00 | 00 00 00 00 01 00 00 00 |rw2.:...|........|
|00002740| a1 00 64 00 0e 64 72 77 | 32 00 3a 00 02 00 24 00 |..d..drw|2.:...$.|
|00002750| 00 00 00 00 a1 00 64 00 | 34 64 72 77 32 00 3a 00 |......d.|4drw2.:.|
|00002760| 01 00 03 00 00 00 12 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002770| 00 00 01 00 01 00 01 00 | 01 00 00 00 00 00 00 00 |........|........|
|00002780| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 a1 00 |........|........|
|00002790| 9a 00 08 ff fb 80 00 00 | 45 c0 00 00 a0 00 98 00 |........|E.......|
|000027a0| 04 00 00 00 0d 00 12 00 | 15 16 80 00 28 00 7b 01 |........|....(.{.|
|000027b0| 95 11 44 65 76 65 6c 6f | 70 65 72 20 53 75 70 70 |..Develo|per Supp|
|000027c0| 6f 72 74 00 a0 00 99 00 | a1 00 64 00 08 64 72 77 |ort.....|..d..drw|
|000027d0| 32 00 3a 00 04 00 a1 14 | e3 00 02 00 01 00 a0 00 |2.:.....|........|
|000027e0| 97 00 a1 00 64 00 60 64 | 72 77 32 00 03 02 00 00 |....d.`d|rw2.....|
|000027f0| 2d 02 00 01 ef 00 00 00 | 00 00 00 00 00 02 02 00 |-.......|........|
|00002800| 00 00 00 00 00 00 00 00 | 00 ff ff ff ff ff ff 00 |........|........|
|00002810| 01 00 01 08 4b 00 00 00 | 00 02 00 01 ef 02 00 00 |....K...|........|
|00002820| 2d 00 00 00 00 00 00 00 | 00 00 01 00 14 00 0c 00 |-.......|........|
|00002830| 03 00 02 00 00 00 5a 00 | 01 00 00 00 02 00 00 00 |......Z.|........|
|00002840| 03 00 0c 00 00 00 00 00 | 07 00 02 00 02 00 08 00 |........|........|
|00002850| 08 00 20 00 66 02 1c 00 | 66 00 5a 00 a1 00 64 00 |.. .f...|f.Z...d.|
|00002860| 31 64 72 77 32 00 02 01 | ca 01 c0 01 fa 01 e9 00 |1drw2...|........|
|00002870| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002880| 00 00 00 ff ff ff ff ff | ff 00 01 00 00 01 4b 00 |........|......K.|
|00002890| 00 00 00 00 a1 00 96 00 | 0c 01 00 00 00 02 78 00 |........|......x.|
|000028a0| 00 00 00 00 00 00 a1 00 | 64 00 10 64 72 77 32 00 |........|d..drw2.|
|000028b0| 3a 00 05 00 00 00 00 00 | 01 00 00 00 a1 00 64 00 |:.......|......d.|
|000028c0| 0e 64 72 77 32 00 3a 00 | 02 00 24 00 00 00 00 00 |.drw2.:.|..$.....|
|000028d0| a1 00 64 00 34 64 72 77 | 32 00 3a 00 01 00 03 00 |..d.4drw|2.:.....|
|000028e0| 00 00 30 00 00 00 00 00 | 00 00 00 00 00 00 01 00 |..0.....|........|
|000028f0| 01 00 01 00 01 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002900| 00 00 00 00 00 00 00 00 | 00 00 a1 00 9a 00 08 ff |........|........|
|00002910| f4 00 00 00 13 80 00 00 | a0 00 98 00 0d 00 30 00 |........|......0.|
|00002920| 28 00 55 01 ef 01 f0 00 | a0 00 99 00 a1 00 64 00 |(.U.....|......d.|
|00002930| 08 64 72 77 32 00 3a 00 | 04 00 a1 14 e3 00 02 00 |.drw2.:.|........|
|00002940| 01 00 a0 00 97 00 a1 00 | 64 00 31 64 72 77 32 00 |........|d.1drw2.|
|00002950| 02 01 ef 01 e6 01 fa 01 | f0 00 00 00 00 00 00 00 |........|........|
|00002960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 ff ff ff |........|........|
|00002970| ff ff ff 00 01 00 00 01 | 00 00 00 00 00 00 a1 00 |........|........|
|00002980| 96 00 0c 01 00 00 00 02 | 78 00 00 00 00 00 00 00 |........|x.......|
|00002990| a1 00 64 00 10 64 72 77 | 32 00 3a 00 05 00 00 00 |..d..drw|2.:.....|
|000029a0| 00 00 01 00 00 00 a1 00 | 64 00 0e 64 72 77 32 00 |........|d..drw2.|
|000029b0| 3a 00 02 00 24 00 00 00 | 00 00 a1 00 64 00 34 64 |:...$...|....d.4d|
|000029c0| 72 77 32 00 3a 00 01 00 | 03 00 00 00 09 00 00 00 |rw2.:...|........|
|000029d0| 00 00 00 00 00 00 00 00 | 01 00 01 00 01 00 01 00 |........|........|
|000029e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000029f0| 00 00 00 00 a1 00 9a 00 | 08 ff fd 80 00 00 04 00 |........|........|
|00002a00| 00 00 a0 00 98 00 0d 00 | 09 00 15 6c 00 00 2b 26 |........|...l..+&|
|00002a10| 09 01 a8 00 a0 00 99 00 | a1 00 64 00 08 64 72 77 |........|..d..drw|
|00002a20| 32 00 3a 00 04 00 a1 14 | e3 00 02 00 01 00 a0 00 |2.:.....|........|
|00002a30| 97 00 a1 00 64 00 31 64 | 72 77 32 00 02 01 e5 00 |....d.1d|rw2.....|
|00002a40| 2d 01 f8 00 79 00 00 00 | 00 00 00 00 00 00 00 00 |-...y...|........|
|00002a50| 00 00 00 00 00 00 00 00 | 00 ff ff ff ff ff ff 00 |........|........|
|00002a60| 01 00 01 01 00 00 00 01 | 00 00 a1 00 96 00 0c 01 |........|........|
|00002a70| 00 00 00 02 78 00 00 00 | 00 00 00 00 a1 00 64 00 |....x...|......d.|
|00002a80| 10 64 72 77 32 00 3a 00 | 05 00 00 00 00 00 01 00 |.drw2.:.|........|
|00002a90| 00 00 a1 00 64 00 0e 64 | 72 77 32 00 3a 00 02 00 |....d..d|rw2.:...|
|00002aa0| 24 00 00 00 00 00 a1 00 | 64 00 34 64 72 77 32 00 |$.......|d.4drw2.|
|00002ab0| 3a 00 01 00 03 00 00 00 | 12 00 00 00 00 00 00 00 |:.......|........|
|00002ac0| 00 00 00 00 01 00 01 00 | 01 00 01 00 00 00 00 00 |........|........|
|00002ad0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ae0| a1 00 9a 00 08 ff fb 80 | 00 00 25 00 00 00 a0 00 |........|..%.....|
|00002af0| 98 00 0d 00 12 00 15 42 | 80 00 28 00 5a 00 5c 09 |.......B|..(.Z.\.|
|00002b00| 4d 61 63 69 6e 74 6f 73 | 68 00 a0 00 99 00 a1 00 |Macintos|h.......|
|00002b10| 64 00 08 64 72 77 32 00 | 3a 00 04 00 a1 14 e3 00 |d..drw2.|:.......|
|00002b20| 02 00 01 00 a0 00 97 00 | a0 00 8d 00 a1 00 64 00 |........|......d.|
|00002b30| 06 64 72 77 32 00 44 00 | a0 00 83 00 a1 00 64 00 |.drw2.D.|......d.|
|00002b40| 04 57 4f 52 44 00 a0 00 | 8d 00 01 00 0a 00 00 00 |.WORD...|........|
|00002b50| 00 03 48 02 52 00 04 01 | 00 00 2e 00 04 00 00 00 |..H.R...|........|
|00002b60| 00 00 10 00 01 00 01 00 | 01 00 01 00 a1 00 64 00 |........|......d.|
|00002b70| 10 4f 4e 4c 4e 00 64 00 | 00 00 8e 00 5a 00 a1 01 |.ONLN.d.|....Z...|
|00002b80| e7 00 28 00 9c 00 5a 2e | 50 54 20 32 38 20 2d 20 |..(...Z.|PT 28 - |
|00002b90| 4d 75 6c 74 69 70 6c 65 | 20 49 6e 68 65 72 69 74 |Multiple| Inherit|
|00002ba0| 61 6e 63 65 20 61 6e 64 | 20 48 61 6e 64 6c 65 4f |ance and| HandleO|
|00002bb0| 62 6a 65 63 74 73 00 00 | 0d 00 0e 00 a1 00 64 00 |bjects..|......d.|
|00002bc0| 10 4f 4e 4c 4e 00 64 00 | 2f 00 a0 00 5a 00 af 00 |.ONLN.d.|/...Z...|
|00002bd0| d6 00 2a 10 11 50 6c 61 | 74 66 6f 72 6d 73 20 26 |..*..Pla|tforms &|
|00002be0| 20 54 6f 6f 6c 73 00 00 | 04 00 00 00 0d 00 0c 00 | Tools..|........|
|00002bf0| a1 00 64 00 10 4f 4e 4c | 4e 00 64 00 42 00 bb 00 |..d..ONL|N.d.B...|
|00002c00| 5a 00 c7 00 8f 00 2a 18 | 0b 57 72 69 74 74 65 6e |Z.....*.|.Written|
|00002c10| 20 62 79 3a 00 00 a1 00 | 64 00 10 4f 4e 4c 4e 00 | by:....|d..ONLN.|
|00002c20| 64 00 4e 00 bb 00 a2 00 | c7 00 f3 00 29 48 10 4c |d.N.....|....)H.L|
|00002c30| 61 72 72 79 20 52 6f 73 | 65 6e 73 74 65 69 6e 00 |arry Ros|enstein.|
|00002c40| a1 00 64 00 10 4f 4e 4c | 4e 00 64 00 5f 00 bb 01 |..d..ONL|N.d._...|
|00002c50| df 00 c7 02 1c 00 28 00 | c4 01 df 0b 41 75 67 75 |......(.|....Augu|
|00002c60| 73 74 20 31 39 39 30 00 | 06 00 04 00 00 00 a1 00 |st 1990.|........|
|00002c70| 64 00 10 4f 4e 4c 4e 00 | 64 00 6b 00 d3 00 5a 00 |d..ONLN.|d.k...Z.|
|00002c80| df 00 aa 00 28 00 dc 00 | 5a 0f 54 68 69 73 20 54 |....(...|Z.This T|
|00002c90| 65 63 68 6e 69 63 61 6c | 20 00 06 00 05 00 00 00 |echnical| .......|
|00002ca0| a1 00 64 00 10 4f 4e 4c | 4e 00 64 00 7a 00 d3 00 |..d..ONL|N.d.z...|
|00002cb0| aa 00 df 02 1c 00 29 50 | 3b 4e 6f 74 65 20 61 6e |......)P|;Note an|
|00002cc0| 73 77 65 72 73 20 61 20 | 63 6f 6d 6d 6f 6e 20 71 |swers a |common q|
|00002cd0| 75 65 73 74 69 6f 6e 20 | 61 62 6f 75 74 20 4d 50 |uestion |about MP|
|00002ce0| 57 20 43 2b 2b 3a 20 20 | d2 57 68 79 20 64 6f 65 |W C++: |.Why doe|
|00002cf0| 73 6e d5 74 00 00 2c 00 | 0a 00 16 07 43 6f 75 72 |sn.t..,.|....Cour|
|00002d00| 69 65 72 00 03 00 16 00 | 06 00 01 00 00 00 a1 00 |ier.....|........|
|00002d10| 64 00 10 4f 4e 4c 4e 00 | 64 00 b6 00 df 00 5a 00 |d..ONLN.|d.....Z.|
|00002d20| eb 00 ae 00 28 00 e9 00 | 5a 0c 48 61 6e 64 6c 65 |....(...|Z.Handle|
|00002d30| 4f 62 6a 65 63 74 00 00 | 03 00 14 00 a1 00 64 00 |Object..|......d.|
|00002d40| 10 4f 4e 4c 4e 00 64 00 | c2 00 e0 00 ae 00 ec 01 |.ONLN.d.|........|
|00002d50| 04 00 29 54 12 20 73 75 | 70 70 6f 72 74 20 6d 75 |..)T. su|pport mu|
|00002d60| 6c 74 69 70 6c 65 20 00 | 06 00 02 00 00 00 a1 00 |ltiple .|........|
|00002d70| 64 00 10 4f 4e 4c 4e 00 | 64 00 d4 00 e0 01 04 00 |d..ONLN.|d.......|
|00002d80| ec 02 1c 00 29 56 39 69 | 6e 68 65 72 69 74 61 6e |....)V9i|nheritan|
|00002d90| 63 65 3f d3 20 20 49 74 | 20 64 6f 65 73 20 74 68 |ce?. It| does th|
|00002da0| 69 73 20 62 79 20 67 69 | 76 69 6e 67 20 61 20 62 |is by gi|ving a b|
|00002db0| 72 69 65 66 20 6f 76 65 | 72 76 69 65 77 20 6f 66 |rief ove|rview of|
|00002dc0| 00 00 06 00 00 00 00 00 | a1 00 64 00 10 4f 4e 4c |........|..d..ONL|
|00002dd0| 4e 00 64 01 0e 00 ec 00 | 5a 00 f8 01 60 00 28 00 |N.d.....|Z...`.(.|
|00002de0| f5 00 5a 33 68 6f 77 20 | 6d 75 6c 74 69 70 6c 65 |..Z3how |multiple|
|00002df0| 20 69 6e 68 65 72 69 74 | 61 6e 63 65 20 69 73 20 | inherit|ance is |
|00002e00| 69 6d 70 6c 65 6d 65 6e | 74 65 64 20 69 6e 20 4d |implemen|ted in M|
|00002e10| 50 57 20 43 2b 2b 2e 00 | 07 00 01 00 01 00 20 01 |PW C++..|...... .|
|00002e20| 04 00 58 01 04 02 1d 00 | 04 01 00 00 0d 00 0e 00 |..X.....|........|
|00002e30| a1 00 64 00 10 4f 4e 4c | 4e 00 64 01 42 01 1d 00 |..d..ONL|N.d.B...|
|00002e40| 5a 01 2c 01 3e 00 2a 34 | 1e 57 68 61 74 20 41 72 |Z.,.>.*4|.What Ar|
|00002e50| 65 20 48 61 6e 64 6c 65 | 4f 62 6a 65 63 74 73 20 |e Handle|Objects |
|00002e60| 41 6e 79 77 61 79 3f 00 | 04 00 00 00 0d 00 0c 00 |Anyway?.|........|
|00002e70| 06 00 05 00 00 00 a1 00 | 64 00 10 4f 4e 4c 4e 00 |........|d..ONLN.|
|00002e80| 64 01 61 01 38 00 5a 01 | 44 01 74 00 2a 18 31 4d |d.a.8.Z.|D.t.*.1M|
|00002e90| 50 57 20 43 2b 2b 20 63 | 6f 6e 74 61 69 6e 73 20 |PW C++ c|ontains |
|00002ea0| 73 65 76 65 72 61 6c 20 | 65 78 74 65 6e 73 69 6f |several |extensio|
|00002eb0| 6e 73 20 74 6f 20 d2 73 | 74 61 6e 64 61 72 64 20 |ns to .s|tandard |
|00002ec0| 00 00 06 00 06 00 00 00 | a1 00 64 00 10 4f 4e 4c |........|..d..ONL|
|00002ed0| 4e 00 64 01 92 01 38 01 | 74 01 44 02 1c 00 28 01 |N.d...8.|t.D...(.|
|00002ee0| 41 01 74 1d 43 2b 2b d3 | 20 66 6f 72 20 73 75 70 |A.t.C++.| for sup|
|00002ef0| 70 6f 72 74 69 6e 67 20 | 4d 61 63 69 6e 74 6f 73 |porting |Macintos|
|00002f00| 68 00 06 00 00 00 00 00 | a1 00 64 00 10 4f 4e 4c |h.......|..d..ONL|
|00002f10| 4e 00 64 01 b0 01 45 00 | 5a 01 51 01 0e 00 28 01 |N.d...E.|Z.Q...(.|
|00002f20| 4e 00 5a 24 70 72 6f 67 | 72 61 6d 6d 69 6e 67 2e |N.Z$prog|ramming.|
|00002f30| 20 20 4f 6e 65 20 73 75 | 63 68 20 65 78 74 65 6e | One su|ch exten|
|00002f40| 73 69 6f 6e 20 69 73 20 | 00 00 06 00 01 00 00 00 |sion is |........|
|00002f50| a1 00 64 00 10 4f 4e 4c | 4e 00 64 01 d4 01 45 01 |..d..ONL|N.d...E.|
|00002f60| 0e 01 51 01 61 00 29 b4 | 13 74 68 65 20 62 75 69 |..Q.a.).|.the bui|
|00002f70| 6c 74 2d 69 6e 20 63 6c | 61 73 73 20 00 00 03 00 |lt-in cl|ass ....|
|00002f80| 16 00 a1 00 64 00 10 4f | 4e 4c 4e 00 64 01 e7 01 |....d..O|NLN.d...|
|00002f90| 44 01 61 01 50 01 b5 00 | 29 53 0c 48 61 6e 64 6c |D.a.P...|)S.Handl|
|00002fa0| 65 4f 62 6a 65 63 74 00 | 03 00 14 00 a1 00 64 00 |eObject.|......d.|
|00002fb0| 10 4f 4e 4c 4e 00 64 01 | f3 01 45 01 b5 01 51 02 |.ONLN.d.|..E...Q.|
|00002fc0| 1c 00 29 54 15 2e 20 20 | 41 6e 20 69 6e 73 74 61 |..)T.. |An insta|
|00002fd0| 6e 63 65 20 6f 66 20 61 | 6e 79 00 00 06 00 00 00 |nce of a|ny......|
|00002fe0| 00 00 a1 00 64 00 10 4f | 4e 4c 4e 00 64 02 09 01 |....d..O|NLN.d...|
|00002ff0| 52 00 5a 01 5e 00 c2 00 | 28 01 5b 00 5a 15 63 6c |R.Z.^...|(.[.Z.cl|
|00003000| 61 73 73 20 64 65 73 63 | 65 6e 64 65 64 20 66 72 |ass desc|ended fr|
|00003010| 6f 6d 20 00 03 00 16 00 | a1 00 64 00 10 4f 4e 4c |om .....|..d..ONL|
|00003020| 4e 00 64 02 1e 01 51 00 | c2 01 5d 01 16 00 29 68 |N.d...Q.|..]...)h|
|00003030| 0c 48 61 6e 64 6c 65 4f | 62 6a 65 63 74 00 03 00 |.HandleO|bject...|
|00003040| 14 00 a1 00 64 00 10 4f | 4e 4c 4e 00 64 02 2a 01 |....d..O|NLN.d.*.|
|00003050| 52 01 16 01 5e 01 24 00 | 29 54 04 20 69 73 20 00 |R...^.$.|)T. is .|
|00003060| 06 00 01 00 00 00 a1 00 | 64 00 10 4f 4e 4c 4e 00 |........|d..ONLN.|
|00003070| 64 02 2e 01 52 01 24 01 | 5e 02 1c 00 29 0e 34 61 |d...R.$.|^...).4a|
|00003080| 6c 6c 6f 63 61 74 65 64 | 20 61 73 20 61 20 68 61 |llocated| as a ha|
|00003090| 6e 64 6c 65 20 69 6e 20 | 74 68 65 20 68 65 61 70 |ndle in |the heap|
|000030a0| 2e 20 20 59 6f 75 20 72 | 65 66 65 72 20 74 6f 20 |. You r|efer to |
|000030b0| 6f 6e 65 00 06 00 00 00 | 00 00 a1 00 64 00 10 4f |one.....|....d..O|
|000030c0| 4e 4c 4e 00 64 02 63 01 | 5e 00 5a 01 6a 01 78 00 |NLN.d.c.|^.Z.j.x.|
|000030d0| 28 01 67 00 5a 40 6f 66 | 20 74 68 65 73 65 20 69 |(.g.Z@of| these i|
|000030e0| 6e 73 74 61 6e 63 65 73 | 20 61 73 20 69 66 20 69 |nstances| as if i|
|000030f0| 74 20 77 65 72 65 20 61 | 20 73 69 6d 70 6c 65 20 |t were a| simple |
|00003100| 70 6f 69 6e 74 65 72 3b | 20 74 68 65 20 63 6f 6d |pointer;| the com|
|00003110| 70 69 6c 65 72 20 00 00 | 06 00 01 00 00 00 a1 00 |piler ..|........|
|00003120| 64 00 10 4f 4e 4c 4e 00 | 64 02 a3 01 5e 01 78 01 |d..ONLN.|d...^.x.|
|00003130| 6a 02 1c 00 28 01 67 01 | 78 23 74 61 6b 65 73 20 |j...(.g.|x#takes |
|00003140| 63 61 72 65 20 6f 66 20 | 74 68 65 20 65 78 74 72 |care of |the extr|
|00003150| 61 20 64 65 72 65 66 65 | 72 65 6e 63 65 00 06 00 |a derefe|rence...|
|00003160| 00 00 00 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 02 |......d.|.ONLN.d.|
|00003170| c7 01 6a 00 5a 01 76 01 | 2f 00 28 01 73 00 5a 2f |..j.Z.v.|/.(.s.Z/|
|00003180| 72 65 71 75 69 72 65 64 | 20 62 65 63 61 75 73 65 |required| because|
|00003190| 20 74 68 65 20 6f 62 6a | 65 63 74 20 69 73 20 72 | the obj|ect is r|
|000031a0| 65 61 6c 6c 79 20 61 20 | 68 61 6e 64 6c 65 2e 00 |eally a |handle..|
|000031b0| 06 00 02 00 00 00 a1 00 | 64 00 10 4f 4e 4c 4e 00 |........|d..ONLN.|
|000031c0| 64 02 f7 01 83 00 5a 01 | 8f 00 67 00 2a 19 02 41 |d.....Z.|..g.*..A|
|000031d0| 20 00 03 00 16 00 a1 00 | 64 00 10 4f 4e 4c 4e 00 | .......|d..ONLN.|
|000031e0| 64 02 f9 01 82 00 67 01 | 8e 00 bb 00 29 0d 0c 48 |d.....g.|....)..H|
|000031f0| 61 6e 64 6c 65 4f 62 6a | 65 63 74 00 03 00 14 00 |andleObj|ect.....|
|00003200| a1 00 64 00 10 4f 4e 4c | 4e 00 64 03 05 01 83 00 |..d..ONL|N.d.....|
|00003210| bb 01 8f 01 33 00 29 54 | 18 20 69 73 20 75 73 65 |....3.)T|. is use|
|00003220| 66 75 6c 20 69 6e 20 4d | 61 63 69 6e 74 6f 73 68 |ful in M|acintosh|
|00003230| 20 00 06 00 03 00 00 00 | a1 00 64 00 10 4f 4e 4c | .......|..d..ONL|
|00003240| 4e 00 64 03 1d 01 83 01 | 33 01 8f 02 1c 00 29 78 |N.d.....|3.....)x|
|00003250| 2b 70 72 6f 67 72 61 6d | 6d 69 6e 67 20 66 6f 72 |+program|ming for|
|00003260| 20 74 68 65 20 73 61 6d | 65 20 72 65 61 73 6f 6e | the sam|e reason|
|00003270| 20 61 20 68 61 6e 64 6c | 65 20 69 73 00 00 06 00 | a handl|e is....|
|00003280| 00 00 00 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 03 |......d.|.ONLN.d.|
|00003290| 49 01 90 00 5a 01 9c 01 | 83 00 28 01 99 00 5a 3f |I...Z...|..(...Z?|
|000032a0| 75 73 65 66 75 6c 2e 20 | 20 54 68 65 20 75 73 65 |useful. | The use|
|000032b0| 20 6f 66 20 68 61 6e 64 | 6c 65 73 20 68 65 6c 70 | of hand|les help|
|000032c0| 73 20 70 72 65 76 65 6e | 74 20 68 65 61 70 20 66 |s preven|t heap f|
|000032d0| 72 61 67 6d 65 6e 74 61 | 74 69 6f 6e 2e 20 20 00 |ragmenta|tion. .|
|000032e0| 06 00 01 00 00 00 a1 00 | 64 00 10 4f 4e 4c 4e 00 |........|d..ONLN.|
|000032f0| 64 03 88 01 90 01 83 01 | 9c 01 c8 00 28 01 99 01 |d.......|....(...|
|00003300| 83 0e 54 68 65 20 6e 61 | 74 75 72 65 20 6f 66 20 |..The na|ture of |
|00003310| 00 00 03 00 16 00 a1 00 | 64 00 10 4f 4e 4c 4e 00 |........|d..ONLN.|
|00003320| 64 03 96 01 8f 01 c8 01 | 9b 02 1c 00 29 45 0c 48 |d.......|....)E.H|
|00003330| 61 6e 64 6c 65 4f 62 6a | 65 63 74 00 03 00 14 00 |andleObj|ect.....|
|00003340| 06 00 00 00 00 00 a1 00 | 64 00 10 4f 4e 4c 4e 00 |........|d..ONLN.|
|00003350| 64 03 a3 01 9c 00 5a 01 | a8 01 b2 00 28 01 a5 00 |d.....Z.|....(...|
|00003360| 5a 46 69 6d 70 6f 73 65 | 73 20 73 6f 6d 65 20 72 |ZFimpose|s some r|
|00003370| 65 73 74 72 69 63 74 69 | 6f 6e 73 20 6f 6e 20 68 |estricti|ons on h|
|00003380| 6f 77 20 79 6f 75 20 63 | 61 6e 20 75 73 65 20 69 |ow you c|an use i|
|00003390| 74 20 69 6e 20 61 20 70 | 72 6f 67 72 61 6d 2c 20 |t in a p|rogram, |
|000033a0| 68 6f 77 65 76 65 72 2e | 00 00 a1 00 64 00 10 4f |however.|....d..O|
|000033b0| 4e 4c 4e 00 64 03 ea 01 | b4 00 5a 01 c0 01 4e 00 |NLN.d...|..Z...N.|
|000033c0| 2a 18 38 46 69 72 73 74 | 2c 20 73 69 6e 63 65 20 |*.8First|, since |
|000033d0| 65 61 63 68 20 69 6e 73 | 74 61 6e 63 65 20 69 73 |each ins|tance is|
|000033e0| 20 61 6c 6c 6f 63 61 74 | 65 64 20 61 73 20 61 20 | allocat|ed as a |
|000033f0| 68 61 6e 64 6c 65 2c 20 | 69 74 20 00 06 00 01 00 |handle, |it .....|
|00003400| 00 00 a1 00 64 00 10 4f | 4e 4c 4e 00 64 04 22 01 |....d..O|NLN.d.".|
|00003410| b4 01 4e 01 c0 02 1c 00 | 29 f4 2c 66 6f 6c 6c 6f |..N.....|).,follo|
|00003420| 77 73 20 74 68 61 74 20 | 61 6c 6c 20 69 6e 73 74 |ws that |all inst|
|00003430| 61 6e 63 65 73 20 6d 75 | 73 74 20 62 65 20 61 6c |ances mu|st be al|
|00003440| 6c 6f 63 61 74 65 64 00 | a1 00 64 00 10 4f 4e 4c |located.|..d..ONL|
|00003450| 4e 00 64 04 4f 01 c0 00 | 5a 01 cc 01 22 00 28 01 |N.d.O...|Z...".(.|
|00003460| c9 00 5a 28 6f 6e 20 74 | 68 65 20 68 65 61 70 2e |..Z(on t|he heap.|
|00003470| 20 20 28 d2 4e 61 74 69 | 76 65 d3 20 43 2b 2b 20 | (.Nati|ve. C++ |
|00003480| 6f 62 6a 65 63 74 73 20 | 63 61 6e 20 00 00 06 00 |objects |can ....|
|00003490| 02 00 00 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 04 |......d.|.ONLN.d.|
|000034a0| 77 01 c0 01 22 01 cc 02 | 1c 00 29 c8 33 62 65 20 |w..."...|..).3be |
|000034b0| 61 6c 6c 6f 63 61 74 65 | 64 20 6f 6e 20 74 68 65 |allocate|d on the|
|000034c0| 20 73 74 61 63 6b 20 6f | 72 20 69 6e 20 74 68 65 | stack o|r in the|
|000034d0| 20 67 6c 6f 62 61 6c 20 | 73 70 61 63 65 20 61 73 | global |space as|
|000034e0| 00 00 06 00 00 00 00 00 | a1 00 64 00 10 4f 4e 4c |........|..d..ONL|
|000034f0| 4e 00 64 04 ab 01 cc 00 | 5a 01 d8 01 ef 00 28 01 |N.d.....|Z.....(.|
|00003500| d5 00 5a 57 77 65 6c 6c | 2e 29 20 20 43 6f 6e 73 |..ZWwell|.) Cons|
|00003510| 65 71 75 65 6e 74 6c 79 | 2c 20 79 6f 75 20 61 6c |equently|, you al|
|00003520| 77 61 79 73 20 64 65 63 | 6c 61 72 65 20 76 61 72 |ways dec|lare var|
|00003530| 69 61 62 6c 65 73 2c 20 | 70 61 72 61 6d 65 74 65 |iables, |paramete|
|00003540| 72 73 2c 20 65 74 63 2e | 20 74 6f 20 62 65 20 70 |rs, etc.| to be p|
|00003550| 6f 69 6e 74 65 72 73 20 | 74 6f 20 00 06 00 01 00 |ointers |to .....|
|00003560| 00 00 a1 00 64 00 10 4f | 4e 4c 4e 00 64 05 02 01 |....d..O|NLN.d...|
|00003570| cc 01 ef 01 d8 02 1c 00 | 28 01 d5 01 ef 0a 74 68 |........|(.....th|
|00003580| 65 20 63 6c 61 73 73 2e | 00 00 06 00 00 00 00 00 |e class.|........|
|00003590| a1 00 64 00 10 4f 4e 4c | 4e 00 64 05 0e 01 d8 00 |..d..ONL|N.d.....|
|000035a0| 5a 01 e4 00 98 00 28 01 | e1 00 5a 0c 46 6f 72 20 |Z.....(.|..Z.For |
|000035b0| 65 78 61 6d 70 6c 65 3a | 00 00 03 00 16 00 0d 00 |example:|........|
|000035c0| 09 00 a1 00 64 00 10 4f | 4e 4c 4e 00 64 05 1b 01 |....d..O|NLN.d...|
|000035d0| f0 00 5a 01 fb 01 22 00 | 2a 17 28 20 20 20 20 63 |..Z...".|*.( c|
|000035e0| 6c 61 73 73 20 54 53 61 | 6d 70 6c 65 3a 20 70 75 |lass TSa|mple: pu|
|000035f0| 62 6c 69 63 20 48 61 6e | 64 6c 65 4f 62 6a 65 63 |blic Han|dleObjec|
|00003600| 74 20 7b 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 05 |t {...d.|.ONLN.d.|
|00003610| 44 01 fa 00 5a 02 05 00 | 91 00 2a 0a 0b 20 20 20 |D...Z...|..*.. |
|00003620| 20 70 75 62 6c 69 63 3a | 00 00 a1 00 64 00 10 4f | public:|....d..O|
|00003630| 4e 4c 4e 00 64 05 50 02 | 04 00 5a 02 0f 00 87 00 |NLN.d.P.|..Z.....|
|00003640| 2a 0a 09 20 20 20 20 20 | 20 20 20 c9 00 00 a1 00 |*.. | .....|
|00003650| 64 00 10 4f 4e 4c 4e 00 | 64 05 5a 02 0e 00 5a 02 |d..ONLN.|d.Z...Z.|
|00003660| 19 00 c8 00 2a 0a 16 20 | 20 20 20 20 20 20 20 6c |....*.. | l|
|00003670| 6f 6e 67 20 20 20 20 66 | 44 61 74 61 3b 00 a1 00 |ong f|Data;...|
|00003680| 64 00 10 4f 4e 4c 4e 00 | 64 05 71 02 18 00 5a 02 |d..ONLN.|d.q...Z.|
|00003690| 23 00 78 00 2a 0a 06 20 | 20 20 20 7d 3b 00 a1 00 |#.x.*.. | };...|
|000036a0| 64 00 10 4f 4e 4c 4e 00 | 64 05 78 02 2e 00 5a 02 |d..ONLN.|d.x...Z.|
|000036b0| 39 01 40 00 2a 16 2e 20 | 20 20 20 54 53 61 6d 70 |9.@.*.. | TSamp|
|000036c0| 6c 65 20 20 2a 61 53 61 | 6d 70 6c 65 49 6e 73 74 |le *aSa|mpleInst|
|000036d0| 61 6e 63 65 3b 20 20 20 | 20 20 20 20 20 2f 2f 20 |ance; | // |
|000036e0| 4c 65 67 61 6c 00 a1 00 | 64 00 10 4f 4e 4c 4e 00 |Legal...|d..ONLN.|
|000036f0| 64 05 a7 02 38 00 5a 02 | 43 01 c2 00 2a 0a 48 20 |d...8.Z.|C...*.H |
|00003700| 20 20 20 54 53 61 6d 70 | 6c 65 20 20 61 6e 6f 74 | TSamp|le anot|
|00003710| 68 65 72 53 61 6d 70 6c | 65 3b 20 20 20 20 20 20 |herSampl|e; |
|00003720| 20 20 20 20 20 2f 2f 20 | 52 65 73 75 6c 74 73 20 | // |Results |
|00003730| 69 6e 20 61 20 63 6f 6d | 70 69 6c 65 2d 74 69 6d |in a com|pile-tim|
|00003740| 65 20 65 72 72 6f 72 00 | 03 00 14 00 0d 00 0c 00 |e error.|........|
|00003750| a1 00 64 00 10 4f 4e 4c | 4e 00 64 05 f0 02 4e 00 |..d..ONL|N.d...N.|
|00003760| 5a 02 5a 00 b4 00 2a 17 | 12 54 68 65 20 65 72 72 |Z.Z...*.|.The err|
|00003770| 6f 72 20 6d 65 73 73 61 | 67 65 20 00 06 00 01 00 |or messa|ge .....|
|00003780| 00 00 a1 00 64 00 10 4f | 4e 4c 4e 00 64 06 02 02 |....d..O|NLN.d...|
|00003790| 4e 00 b4 02 5a 02 1c 00 | 29 5a 4d 74 68 65 20 63 |N...Z...|)ZMthe c|
|000037a0| 6f 6d 70 69 6c 65 72 20 | 67 65 6e 65 72 61 74 65 |ompiler |generate|
|000037b0| 73 20 69 6e 20 74 68 69 | 73 20 63 61 73 65 20 69 |s in thi|s case i|
|000037c0| 73 20 d2 43 61 6e d5 74 | 20 64 65 63 6c 61 72 65 |s .Can.t| declare|
|000037d0| 20 61 20 68 61 6e 64 6c | 65 2f 70 61 73 63 61 6c | a handl|e/pascal|
|000037e0| 20 6f 62 6a 65 63 74 3a | 00 00 a1 00 64 00 10 4f | object:|....d..O|
|000037f0| 4e 4c 4e 00 64 06 50 02 | 5a 00 5a 02 66 01 e2 00 |NLN.d.P.|Z.Z.f...|
|00003800| 28 02 63 00 5a 50 61 6e | 6f 74 68 65 72 53 61 6d |(.c.ZPan|otherSam|
|00003810| 70 6c 65 2e d3 20 20 41 | 74 20 66 69 72 73 74 20 |ple.. A|t first |
|00003820| 74 68 69 73 20 6d 65 73 | 73 61 67 65 20 6d 69 67 |this mes|sage mig|
|00003830| 68 74 20 73 65 65 6d 20 | 73 74 72 61 6e 67 65 2c |ht seem |strange,|
|00003840| 20 62 65 63 61 75 73 65 | 20 74 68 65 20 6c 61 73 | because| the las|
|00003850| 74 20 74 77 6f 20 00 00 | 06 00 02 00 00 00 a1 00 |t two ..|........|
|00003860| 64 00 10 4f 4e 4c 4e 00 | 64 06 a0 02 5a 01 e2 02 |d..ONLN.|d...Z...|
|00003870| 66 02 1c 00 28 02 63 01 | e2 0d 6c 69 6e 65 73 20 |f...(.c.|..lines |
|00003880| 69 6e 20 74 68 69 73 00 | 06 00 00 00 00 00 a1 00 |in this.|........|
|00003890| 64 00 10 4f 4e 4c 4e 00 | 64 06 ae 02 66 00 5a 02 |d..ONLN.|d...f.Z.|
|000038a0| 72 01 ac 00 28 02 6f 00 | 5a 4c 63 6f 64 65 20 73 |r...(.o.|ZLcode s|
|000038b0| 65 65 6d 20 74 6f 20 62 | 6f 74 68 20 64 65 63 6c |eem to b|oth decl|
|000038c0| 61 72 65 20 6f 62 6a 65 | 63 74 73 2e 20 20 41 63 |are obje|cts. Ac|
|000038d0| 74 75 61 6c 6c 79 2c 20 | 74 68 65 20 66 69 72 73 |tually, |the firs|
|000038e0| 74 20 64 65 63 6c 61 72 | 61 74 69 6f 6e 20 69 73 |t declar|ation is|
|000038f0| 20 6f 66 20 61 20 00 00 | 04 02 00 00 a1 00 64 00 | of a ..|......d.|
|00003900| 10 4f 4e 4c 4e 00 64 06 | fa 02 66 01 ac 02 72 01 |.ONLN.d.|..f...r.|
|00003910| cd 00 28 02 6f 01 ac 07 | 70 6f 69 6e 74 65 72 00 |..(.o...|pointer.|
|00003920| 04 00 00 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 07 |......d.|.ONLN.d.|
|00003930| 01 02 66 01 cd 02 72 02 | 0d 00 29 21 0f 20 74 6f |..f...r.|..)!. to|
|00003940| 20 61 6e 20 6f 62 6a 65 | 63 74 2c 20 00 00 06 00 | an obje|ct, ....|
|00003950| 01 00 00 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 07 |......d.|.ONLN.d.|
|00003960| 10 02 66 02 0d 02 72 02 | 1c 00 29 40 03 6e 6f 74 |..f...r.|..)@.not|
|00003970| 00 00 06 00 00 00 00 00 | a1 00 64 00 10 4f 4e 4c |........|..d..ONL|
|00003980| 4e 00 64 07 14 02 72 00 | 5a 02 7e 00 b2 00 28 02 |N.d...r.|Z.~...(.|
|00003990| 7b 00 5a 15 6f 66 20 74 | 68 65 20 6f 62 6a 65 63 |{.Z.of t|he objec|
|000039a0| 74 20 69 74 73 65 6c 66 | 2e 00 06 00 01 00 00 00 |t itself|........|
|000039b0| a1 00 64 00 10 4f 4e 4c | 4e 00 64 07 2a 02 8a 00 |..d..ONL|N.d.*...|
|000039c0| 5a 02 96 01 1a 00 2a 18 | 28 54 68 65 20 73 65 63 |Z.....*.|(The sec|
|000039d0| 6f 6e 64 20 72 65 73 74 | 72 69 63 74 69 6f 6e 20 |ond rest|riction |
|000039e0| 69 73 20 74 68 61 74 20 | 79 6f 75 20 6d 75 73 74 |is that |you must|
|000039f0| 20 00 06 00 02 00 00 00 | a1 00 64 00 10 4f 4e 4c | .......|..d..ONL|
|00003a00| 4e 00 64 07 52 02 8a 01 | 1a 02 96 02 1c 00 29 c0 |N.d.R...|......).|
|00003a10| 34 66 6f 6c 6c 6f 77 20 | 74 68 65 20 75 73 75 61 |4follow |the usua|
|00003a20| 6c 20 72 75 6c 65 73 20 | 66 6f 72 20 6d 61 6e 69 |l rules |for mani|
|00003a30| 70 75 6c 61 74 69 6e 67 | 20 68 61 6e 64 6c 65 73 |pulating| handles|
|00003a40| 2e 20 20 49 6e 00 06 00 | 03 00 00 00 a1 00 64 00 |. In...|......d.|
|00003a50| 10 4f 4e 4c 4e 00 64 07 | 87 02 97 00 5a 02 a3 01 |.ONLN.d.|....Z...|
|00003a60| 9b 00 28 02 a0 00 5a 40 | 70 61 72 74 69 63 75 6c |..(...Z@|particul|
|00003a70| 61 72 2c 20 79 6f 75 20 | 68 61 76 65 20 74 6f 20 |ar, you |have to |
|00003a80| 62 65 20 63 61 72 65 66 | 75 6c 20 61 62 6f 75 74 |be caref|ul about|
|00003a90| 20 63 72 65 61 74 69 6e | 67 20 70 6f 69 6e 74 65 | creatin|g pointe|
|00003aa0| 72 73 20 74 6f 20 61 20 | 00 00 03 00 16 00 06 00 |rs to a |........|
|00003ab0| 04 00 00 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 07 |......d.|.ONLN.d.|
|00003ac0| c7 02 96 01 9b 02 a2 01 | ef 00 28 02 a0 01 9b 0c |........|..(.....|
|00003ad0| 48 61 6e 64 6c 65 4f 62 | 6a 65 63 74 00 00 03 00 |HandleOb|ject....|
|00003ae0| 14 00 a1 00 64 00 10 4f | 4e 4c 4e 00 64 07 d3 02 |....d..O|NLN.d...|
|00003af0| 97 01 ef 02 a3 02 1c 00 | 29 54 09 20 69 6e 73 74 |........|)T. inst|
|00003b00| 61 6e 63 65 00 00 06 00 | 00 00 00 00 a1 00 64 00 |ance....|......d.|
|00003b10| 10 4f 4e 4c 4e 00 64 07 | dd 02 a3 00 5a 02 af 01 |.ONLN.d.|....Z...|
|00003b20| bf 00 28 02 ac 00 5a 4d | 76 61 72 69 61 62 6c 65 |..(...ZM|variable|
|00003b30| 2c 20 73 69 6e 63 65 20 | 74 68 65 20 6f 62 6a 65 |, since |the obje|
|00003b40| 63 74 20 6d 69 67 68 74 | 20 6d 6f 76 65 20 69 66 |ct might| move if|
|00003b50| 20 74 68 65 20 68 65 61 | 70 20 69 73 20 63 6f 6d | the hea|p is com|
|00003b60| 70 61 63 74 65 64 2e 20 | 20 49 66 20 79 6f 75 20 |pacted. | If you |
|00003b70| 77 72 69 74 65 00 20 02 | bd 00 58 02 bd 02 1d 00 |write. .|..X.....|
|00003b80| 0d 00 0a 00 2a 29 2e 50 | 54 20 32 38 20 2d 20 4d |....*).P|T 28 - M|
|00003b90| 75 6c 74 69 70 6c 65 20 | 49 6e 68 65 72 69 74 61 |ultiple |Inherita|
|00003ba0| 6e 63 65 20 61 6e 64 20 | 48 61 6e 64 6c 65 4f 62 |nce and |HandleOb|
|00003bb0| 6a 65 63 74 73 00 28 02 | d5 02 04 01 31 00 29 05 |jects.(.|....1.).|
|00003bc0| 05 20 6f 66 20 35 00 00 | 28 02 eb 00 5a 11 50 6c |. of 5..|(...Z.Pl|
|00003bd0| 61 74 66 6f 72 6d 73 20 | 26 20 54 6f 6f 6c 73 00 |atforms |& Tools.|
|00003be0| ff 00 a1 00 c0 01 f4 25 | 25 44 53 49 44 49 43 54 |.......%|%DSIDICT|
|00003bf0| 3a 5f 63 76 0d 63 75 72 | 72 65 6e 74 64 69 63 74 |:_cv.cur|rentdict|
|00003c00| 20 2f 62 75 20 6b 6e 6f | 77 6e 20 7b 62 75 7d 69 | /bu kno|wn {bu}i|
|00003c10| 66 0d 75 73 65 72 64 69 | 63 74 20 2f 5f 63 76 20 |f.userdi|ct /_cv |
|00003c20| 6b 6e 6f 77 6e 20 6e 6f | 74 7b 75 73 65 72 64 69 |known no|t{userdi|
|00003c30| 63 74 20 2f 5f 63 76 20 | 33 30 20 64 69 63 74 20 |ct /_cv |30 dict |
|00003c40| 70 75 74 7d 69 66 0d 5f | 63 76 20 62 65 67 69 6e |put}if._|cv begin|
|00003c50| 0d 2f 62 64 66 7b 62 69 | 6e 64 20 64 65 66 7d 62 |./bdf{bi|nd def}b|
|00003c60| 69 6e 64 20 64 65 66 0d | 63 75 72 72 65 6e 74 73 |ind def.|currents|
|00003c70| 63 72 65 65 6e 2f 63 73 | 20 65 78 63 68 20 64 65 |creen/cs| exch de|
|00003c80| 66 2f 63 61 20 65 78 63 | 68 20 64 65 66 2f 63 66 |f/ca exc|h def/cf|
|00003c90| 20 65 78 63 68 20 64 65 | 66 0d 2f 73 65 74 63 6d | exch de|f./setcm|
|00003ca0| 79 6b 63 6f 6c 6f 72 20 | 77 68 65 72 65 7b 2f 73 |ykcolor |where{/s|
|00003cb0| 65 74 63 6d 79 6b 63 6f | 6c 6f 72 20 67 65 74 20 |etcmykco|lor get |
|00003cc0| 2f 63 76 63 6d 79 6b 20 | 65 78 63 68 20 64 65 66 |/cvcmyk |exch def|
|00003cd0| 7d 7b 2f 63 76 63 6d 79 | 6b 7b 31 20 73 75 62 20 |}{/cvcmy|k{1 sub |
|00003ce0| 34 20 31 20 72 6f 6c 6c | 20 33 7b 33 20 69 6e 64 |4 1 roll| 3{3 ind|
|00003cf0| 65 78 20 61 64 64 20 6e | 65 67 20 64 75 70 20 30 |ex add n|eg dup 0|
|00003d00| 20 6c 74 7b 70 6f 70 20 | 30 7d 69 66 20 33 20 31 | lt{pop |0}if 3 1|
|00003d10| 20 72 6f 6c 6c 7d 72 65 | 70 65 61 74 20 73 65 74 | roll}re|peat set|
|00003d20| 72 67 62 63 6f 6c 6f 72 | 20 70 6f 70 7d 62 64 66 |rgbcolor| pop}bdf|
|00003d30| 20 7d 69 66 65 6c 73 65 | 0d 2f 73 73 7b 2f 2f 63 | }ifelse|./ss{//c|
|00003d40| 66 20 2f 2f 63 61 20 2f | 2f 63 73 20 73 65 74 73 |f //ca /|/cs sets|
|00003d50| 63 72 65 65 6e 7d 62 64 | 66 0d 2f 73 74 67 7b 73 |creen}bd|f./stg{s|
|00003d60| 73 20 73 65 74 67 72 61 | 79 7d 62 64 66 0d 2f 73 |s setgra|y}bdf./s|
|00003d70| 74 72 67 62 7b 73 73 20 | 73 65 74 72 67 62 63 6f |trgb{ss |setrgbco|
|00003d80| 6c 6f 72 7d 62 64 66 0d | 2f 73 74 63 6d 79 6b 7b |lor}bdf.|/stcmyk{|
|00003d90| 73 73 20 63 76 63 6d 79 | 6b 7d 62 64 66 0d 2f 6d |ss cvcmy|k}bdf./m|
|00003da0| 69 6e 31 7b 64 75 70 20 | 30 20 65 71 7b 70 6f 70 |in1{dup |0 eq{pop|
|00003db0| 20 31 7d 69 66 7d 62 64 | 66 0d 65 6e 64 0d 63 75 | 1}if}bd|f.end.cu|
|00003dc0| 72 72 65 6e 74 64 69 63 | 74 20 2f 62 6e 20 6b 6e |rrentdic|t /bn kn|
|00003dd0| 6f 77 6e 20 7b 62 6e 7d | 69 66 0d 00 a0 00 bf 11 |own {bn}|if......|
|00003de0| 8a 00 00 00 00 03 48 02 | 52 00 11 02 ff 0c 00 ff |......H.|R.......|
|00003df0| ff ff ff 00 00 00 00 00 | 00 00 00 02 52 00 00 03 |........|....R...|
|00003e00| 48 00 00 00 00 00 00 00 | 1e 00 01 00 0a 00 00 00 |H.......|........|
|00003e10| 00 03 48 02 52 00 2c 00 | 08 00 14 05 54 69 6d 65 |..H.R.,.|....Time|
|00003e20| 73 00 03 00 14 00 0d 00 | 0a 00 2e 00 04 00 00 00 |s.......|........|
|00003e30| 00 00 2b 36 2d 19 4d 61 | 63 69 6e 74 6f 73 68 20 |..+6-.Ma|cintosh |
|00003e40| 54 65 63 68 6e 69 63 61 | 6c 20 4e 6f 74 65 73 00 |Technica|l Notes.|
|00003e50| 20 00 2f 00 34 00 2f 01 | f9 00 2c 00 0a 00 16 07 | ./.4./.|..,.....|
|00003e60| 43 6f 75 72 69 65 72 00 | 03 00 16 00 0d 00 09 00 |Courier.|........|
|00003e70| a1 00 64 00 10 4f 4e 4c | 4e 00 64 00 00 00 48 00 |..d..ONL|N.d...H.|
|00003e80| 36 00 53 01 0d 00 2a 23 | 2b 20 20 20 20 6c 6f 6e |6.S...*#|+ lon|
|00003e90| 67 20 2a 78 20 3d 20 26 | 20 28 61 53 61 6d 70 6c |g *x = &| (aSampl|
|00003ea0| 65 49 6e 73 74 61 6e 63 | 65 20 2d 3e 20 66 44 61 |eInstanc|e -> fDa|
|00003eb0| 74 61 29 3b 00 00 03 00 | 14 00 0d 00 0c 00 06 00 |ta);....|........|
|00003ec0| 01 00 00 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 00 |......d.|.ONLN.d.|
|00003ed0| 2c 00 5f 00 36 00 6b 00 | 4e 00 2a 18 05 74 68 65 |,._.6.k.|N.*..the|
|00003ee0| 6e 20 00 00 03 00 16 00 | a1 00 64 00 10 4f 4e 4c |n ......|..d..ONL|
|00003ef0| 4e 00 64 00 31 00 5e 00 | 4e 00 6a 00 55 00 29 18 |N.d.1.^.|N.j.U.).|
|00003f00| 01 78 00 00 03 00 14 00 | a1 00 64 00 10 4f 4e 4c |.x......|..d..ONL|
|00003f10| 4e 00 64 00 32 00 5f 00 | 55 00 6b 01 bd 00 29 07 |N.d.2._.|U.k...).|
|00003f20| 4c 20 62 65 63 6f 6d 65 | 73 20 69 6e 76 61 6c 69 |L become|s invali|
|00003f30| 64 20 69 66 20 74 68 65 | 20 6f 62 6a 65 63 74 20 |d if the| object |
|00003f40| 6d 6f 76 65 73 2e 20 20 | 54 68 65 20 73 6f 6c 75 |moves. |The solu|
|00003f50| 74 69 6f 6e 20 69 6e 20 | 74 68 69 73 20 63 61 73 |tion in |this cas|
|00003f60| 65 20 69 73 20 74 6f 20 | 6c 6f 63 6b 20 00 06 00 |e is to |lock ...|
|00003f70| 02 00 00 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 00 |......d.|.ONLN.d.|
|00003f80| 7e 00 5f 01 bd 00 6b 01 | f8 00 28 00 68 01 bd 0d |~._...k.|..(.h...|
|00003f90| 74 68 65 20 6f 62 6a 65 | 63 74 20 69 66 00 06 00 |the obje|ct if...|
|00003fa0| 00 00 00 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 00 |......d.|.ONLN.d.|
|00003fb0| 8c 00 6c 00 36 00 78 00 | e9 00 28 00 75 00 36 28 |..l.6.x.|..(.u.6(|
|00003fc0| 74 68 65 72 65 d5 73 20 | 61 20 70 6f 73 73 69 62 |there.s |a possib|
|00003fd0| 69 6c 69 74 79 20 6f 66 | 20 74 68 65 20 68 65 61 |ility of| the hea|
|00003fe0| 70 20 62 65 69 6e 67 20 | 00 00 06 00 01 00 00 00 |p being |........|
|00003ff0| a1 00 64 00 10 4f 4e 4c | 4e 00 64 00 b4 00 6c 00 |..d..ONL|N.d...l.|
|00004000| e9 00 78 01 65 00 29 b3 | 19 63 6f 6d 70 61 63 74 |..x.e.).|.compact|
|00004010| 65 64 2e 20 20 49 6e 73 | 74 61 6e 63 65 73 20 6f |ed. Ins|tances o|
|00004020| 66 20 00 00 03 00 16 00 | a1 00 64 00 10 4f 4e 4c |f ......|..d..ONL|
|00004030| 4e 00 64 00 cd 00 6b 01 | 65 00 77 01 b9 00 29 7c |N.d...k.|e.w...)||
|00004040| 0c 48 61 6e 64 6c 65 4f | 62 6a 65 63 74 00 03 00 |.HandleO|bject...|
|00004050| 14 00 a1 00 64 00 10 4f | 4e 4c 4e 00 64 00 d9 00 |....d..O|NLN.d...|
|00004060| 6c 01 b9 00 78 01 f8 00 | 29 54 0e 20 61 72 65 20 |l...x...|)T. are |
|00004070| 61 6c 6c 6f 63 61 74 65 | 64 00 06 00 00 00 00 00 |allocate|d.......|
|00004080| a1 00 64 00 10 4f 4e 4c | 4e 00 64 00 e8 00 79 00 |..d..ONL|N.d...y.|
|00004090| 36 00 85 00 75 00 28 00 | 82 00 36 0f 77 69 74 68 |6...u.(.|..6.with|
|000040a0| 20 61 20 63 61 6c 6c 20 | 74 6f 20 00 03 00 16 00 | a call |to .....|
|000040b0| a1 00 64 00 10 4f 4e 4c | 4e 00 64 00 f7 00 78 00 |..d..ONL|N.d...x.|
|000040c0| 75 00 84 00 bb 00 29 3f | 0a 5f 4e 65 77 48 61 6e |u.....)?|._NewHan|
|000040d0| 64 6c 65 00 03 00 14 00 | a1 00 64 00 10 4f 4e 4c |dle.....|..d..ONL|
|000040e0| 4e 00 64 01 01 00 79 00 | bb 00 85 00 e5 00 29 46 |N.d...y.|......)F|
|000040f0| 09 2c 20 73 6f 20 79 6f | 75 20 00 00 06 00 01 00 |., so yo|u ......|
|00004100| 00 00 a1 00 64 00 10 4f | 4e 4c 4e 00 64 01 0a 00 |....d..O|NLN.d...|
|00004110| 79 00 e5 00 85 01 0d 00 | 29 2a 08 63 61 6e 20 75 |y.......|)*.can u|
|00004120| 73 65 20 00 03 00 16 00 | a1 00 64 00 10 4f 4e 4c |se .....|..d..ONL|
|00004130| 4e 00 64 01 12 00 78 01 | 0d 00 84 01 37 00 29 28 |N.d...x.|....7.)(|
|00004140| 06 5f 48 4c 6f 63 6b 00 | 03 00 14 00 a1 00 64 00 |._HLock.|......d.|
|00004150| 10 4f 4e 4c 4e 00 64 01 | 18 00 79 01 37 00 85 01 |.ONLN.d.|..y.7...|
|00004160| 50 00 29 2a 05 20 61 6e | 64 20 00 00 03 00 16 00 |P.)*. an|d ......|
|00004170| a1 00 64 00 10 4f 4e 4c | 4e 00 64 01 1d 00 78 01 |..d..ONL|N.d...x.|
|00004180| 50 00 84 01 88 00 29 19 | 08 5f 48 55 6e 6c 6f 63 |P.....).|._HUnloc|
|00004190| 6b 00 03 00 14 00 a1 00 | 64 00 10 4f 4e 4c 4e 00 |k.......|d..ONLN.|
|000041a0| 64 01 25 00 79 01 88 00 | 85 01 f8 00 29 38 17 20 |d.%.y...|....)8. |
|000041b0| 74 6f 20 6c 6f 63 6b 20 | 61 6e 64 20 75 6e 6c 6f |to lock |and unlo|
|000041c0| 63 6b 20 74 68 65 00 00 | 06 00 00 00 00 00 a1 00 |ck the..|........|
|000041d0| 64 00 10 4f 4e 4c 4e 00 | 64 01 3d 00 85 00 36 00 |d..ONLN.|d.=...6.|
|000041e0| 91 00 56 00 28 00 8e 00 | 36 07 6f 62 6a 65 63 74 |..V.(...|6.object|
|000041f0| 2e 00 a1 00 64 00 10 4f | 4e 4c 4e 00 64 01 45 00 |....d..O|NLN.d.E.|
|00004200| 9e 00 36 00 aa 00 a1 00 | 2a 19 19 54 68 65 20 74 |..6.....|*..The t|
|00004210| 68 69 72 64 20 72 65 73 | 74 72 69 63 74 69 6f 6e |hird res|triction|
|00004220| 20 69 73 20 00 00 06 00 | 01 00 00 00 a1 00 64 00 | is ....|......d.|
|00004230| 10 4f 4e 4c 4e 00 64 01 | 5e 00 9e 00 a1 00 aa 01 |.ONLN.d.|^.......|
|00004240| 86 00 29 6b 30 74 68 61 | 74 20 79 6f 75 20 63 61 |..)k0tha|t you ca|
|00004250| 6e 6e 6f 74 20 75 73 65 | 20 6d 75 6c 74 69 70 6c |nnot use| multipl|
|00004260| 65 20 69 6e 68 65 72 69 | 74 61 6e 63 65 20 77 69 |e inheri|tance wi|
|00004270| 74 68 20 61 20 00 03 00 | 16 00 a1 00 64 00 10 4f |th a ...|....d..O|
|00004280| 4e 4c 4e 00 64 01 8e 00 | 9d 01 86 00 a9 01 da 00 |NLN.d...|........|
|00004290| 29 e5 0c 48 61 6e 64 6c | 65 4f 62 6a 65 63 74 00 |)..Handl|eObject.|
|000042a0| 03 00 14 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 01 |......d.|.ONLN.d.|
|000042b0| 9a 00 9e 01 da 00 aa 01 | f8 00 29 54 06 2e 20 20 |........|..)T.. |
|000042c0| 54 68 65 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 01 |The...d.|.ONLN.d.|
|000042d0| a1 00 aa 00 36 00 b6 01 | 3f 00 28 00 b3 00 36 38 |....6...|?.(...68|
|000042e0| 72 65 61 73 6f 6e 20 62 | 65 68 69 6e 64 20 74 68 |reason b|ehind th|
|000042f0| 69 73 20 72 65 73 74 72 | 69 63 74 69 6f 6e 20 69 |is restr|iction i|
|00004300| 73 20 6e 6f 74 20 65 76 | 69 64 65 6e 74 2c 20 68 |s not ev|ident, h|
|00004310| 6f 77 65 76 65 72 2e 20 | 00 00 06 00 02 00 00 00 |owever. |........|
|00004320| a1 00 64 00 10 4f 4e 4c | 4e 00 64 01 d9 00 aa 01 |..d..ONL|N.d.....|
|00004330| 3f 00 b6 01 f8 00 28 00 | b3 01 3f 23 20 54 6f 20 |?.....(.|..?# To |
|00004340| 75 6e 64 65 72 73 74 61 | 6e 64 20 74 68 65 20 72 |understa|nd the r|
|00004350| 65 61 73 6f 6e 2c 20 79 | 6f 75 20 6d 75 73 74 00 |eason, y|ou must.|
|00004360| 06 00 00 00 00 00 a1 00 | 64 00 10 4f 4e 4c 4e 00 |........|d..ONLN.|
|00004370| 64 01 fd 00 b6 00 36 00 | c2 01 22 00 28 00 bf 00 |d.....6.|..".(...|
|00004380| 36 33 6c 6f 6f 6b 20 61 | 74 20 74 68 65 20 69 6d |63look a|t the im|
|00004390| 70 6c 65 6d 65 6e 74 61 | 74 69 6f 6e 20 6f 66 20 |plementa|tion of |
|000043a0| 6d 75 6c 74 69 70 6c 65 | 20 69 6e 68 65 72 69 74 |multiple| inherit|
|000043b0| 61 6e 63 65 2e 00 04 01 | 00 00 0d 00 0e 00 a1 00 |ance....|........|
|000043c0| 64 00 10 4f 4e 4c 4e 00 | 64 02 31 00 da 00 36 00 |d..ONLN.|d.1...6.|
|000043d0| e9 01 1e 00 2a 27 21 49 | 6d 70 6c 65 6d 65 6e 74 |....*'!I|mplement|
|000043e0| 69 6e 67 20 4d 75 6c 74 | 69 70 6c 65 20 49 6e 68 |ing Mult|iple Inh|
|000043f0| 65 72 69 74 61 6e 63 65 | 00 00 04 00 00 00 0d 00 |eritance|........|
|00004400| 0c 00 a1 00 64 00 10 4f | 4e 4c 4e 00 64 02 53 00 |....d..O|NLN.d.S.|
|00004410| f5 00 36 01 01 01 74 00 | 2a 18 41 54 6f 20 75 6e |..6...t.|*.ATo un|
|00004420| 64 65 72 73 74 61 6e 64 | 20 68 6f 77 20 6d 75 6c |derstand| how mul|
|00004430| 74 69 70 6c 65 20 69 6e | 68 65 72 69 74 61 6e 63 |tiple in|heritanc|
|00004440| 65 20 69 73 20 69 6d 70 | 6c 65 6d 65 6e 74 65 64 |e is imp|lemented|
|00004450| 2c 20 6f 6e 65 20 6e 65 | 65 64 73 20 00 00 06 00 |, one ne|eds ....|
|00004460| 01 00 00 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 02 |......d.|.ONLN.d.|
|00004470| 94 00 f5 01 74 01 01 01 | f8 00 28 00 fe 01 74 19 |....t...|..(...t.|
|00004480| 61 20 73 69 6d 70 6c 65 | 20 65 78 61 6d 70 6c 65 |a simple| example|
|00004490| 2e 20 53 75 70 70 6f 73 | 65 00 06 00 00 00 00 00 |. Suppos|e.......|
|000044a0| a1 00 64 00 10 4f 4e 4c | 4e 00 64 02 ae 01 01 00 |..d..ONL|N.d.....|
|000044b0| 36 01 0d 00 d8 00 28 01 | 0a 00 36 22 79 6f 75 20 |6.....(.|..6"you |
|000044c0| 64 65 66 69 6e 65 20 74 | 77 6f 20 63 6c 61 73 73 |define t|wo class|
|000044d0| 65 73 20 61 73 20 66 6f | 6c 6c 6f 77 73 3a 00 00 |es as fo|llows:..|
|000044e0| 03 00 16 00 0d 00 09 00 | a1 00 64 00 10 4f 4e 4c |........|..d..ONL|
|000044f0| 4e 00 64 02 d1 01 19 00 | 36 01 24 00 90 00 2a 17 |N.d.....|6.$...*.|
|00004500| 12 20 20 20 20 63 6c 61 | 73 73 20 54 42 61 73 65 |. cla|ss TBase|
|00004510| 41 20 7b 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 02 |A {...d.|.ONLN.d.|
|00004520| e4 01 23 00 36 01 2e 00 | 6d 00 2a 0a 0b 20 20 20 |..#.6...|m.*.. |
|00004530| 20 70 75 62 6c 69 63 3a | 00 00 a1 00 64 00 10 4f | public:|....d..O|
|00004540| 4e 4c 4e 00 64 02 f0 01 | 2d 00 36 01 38 01 17 00 |NLN.d...|-.6.8...|
|00004550| 2a 0a 2d 20 20 20 20 20 | 20 20 20 76 69 72 74 75 |*.- | virtu|
|00004560| 61 6c 20 76 6f 69 64 20 | 20 53 65 74 56 61 72 41 |al void | SetVarA|
|00004570| 28 6c 6f 6e 67 20 6e 65 | 77 56 61 6c 75 65 29 3b |(long ne|wValue);|
|00004580| 00 00 a1 00 64 00 10 4f | 4e 4c 4e 00 64 03 1e 01 |....d..O|NLN.d...|
|00004590| 37 00 36 01 42 00 c2 00 | 2a 0a 1c 20 20 20 20 20 |7.6.B...|*.. |
|000045a0| 20 20 20 20 20 20 20 20 | 20 20 20 6c 6f 6e 67 20 | | long |
|000045b0| 20 66 56 61 72 41 3b 00 | a1 00 64 00 10 4f 4e 4c | fVarA;.|..d..ONL|
|000045c0| 4e 00 64 03 3b 01 41 00 | 36 01 4c 00 63 00 2a 0a |N.d.;.A.|6.L.c.*.|
|000045d0| 09 20 20 20 20 20 20 20 | 20 c9 00 00 a1 00 64 00 |. | .....d.|
|000045e0| 10 4f 4e 4c 4e 00 64 03 | 45 01 4b 00 36 01 56 00 |.ONLN.d.|E.K.6.V.|
|000045f0| 54 00 2a 0a 06 20 20 20 | 20 7d 3b 00 a1 00 64 00 |T.*.. | };...d.|
|00004600| 10 4f 4e 4c 4e 00 64 03 | 4c 01 5f 00 36 01 6a 00 |.ONLN.d.|L._.6.j.|
|00004610| 90 00 2a 14 12 20 20 20 | 20 63 6c 61 73 73 20 54 |..*.. | class T|
|00004620| 42 61 73 65 42 20 7b 00 | a1 00 64 00 10 4f 4e 4c |BaseB {.|..d..ONL|
|00004630| 4e 00 64 03 5f 01 69 00 | 36 01 74 00 6d 00 2a 0a |N.d._.i.|6.t.m.*.|
|00004640| 0b 20 20 20 20 70 75 62 | 6c 69 63 3a 00 00 a1 00 |. pub|lic:....|
|00004650| 64 00 10 4f 4e 4c 4e 00 | 64 03 6b 01 73 00 36 01 |d..ONLN.|d.k.s.6.|
|00004660| 7e 01 17 00 2a 0a 2d 20 | 20 20 20 20 20 20 20 76 |~...*.- | v|
|00004670| 69 72 74 75 61 6c 20 76 | 6f 69 64 20 20 53 65 74 |irtual v|oid Set|
|00004680| 56 61 72 42 28 6c 6f 6e | 67 20 6e 65 77 56 61 6c |VarB(lon|g newVal|
|00004690| 75 65 29 3b 00 00 a1 00 | 64 00 10 4f 4e 4c 4e 00 |ue);....|d..ONLN.|
|000046a0| 64 03 99 01 7d 00 36 01 | 88 00 c2 00 2a 0a 1c 20 |d...}.6.|....*.. |
|000046b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 6c | | l|
|000046c0| 6f 6e 67 20 20 66 56 61 | 72 42 3b 00 a1 00 64 00 |ong fVa|rB;...d.|
|000046d0| 10 4f 4e 4c 4e 00 64 03 | b6 01 87 00 36 01 92 00 |.ONLN.d.|....6...|
|000046e0| 63 00 2a 0a 09 20 20 20 | 20 20 20 20 20 c9 00 00 |c.*.. | ...|
|000046f0| a1 00 64 00 10 4f 4e 4c | 4e 00 64 03 c0 01 91 00 |..d..ONL|N.d.....|
|00004700| 36 01 9c 00 54 00 2a 0a | 06 20 20 20 20 7d 3b 00 |6...T.*.|. };.|
|00004710| 03 00 14 00 0d 00 0c 00 | 06 00 01 00 00 00 a1 00 |........|........|
|00004720| 64 00 10 4f 4e 4c 4e 00 | 64 03 c7 01 a7 00 36 01 |d..ONLN.|d.....6.|
|00004730| b3 01 a7 00 2a 17 4c 49 | 66 20 79 6f 75 20 77 65 |....*.LI|f you we|
|00004740| 72 65 20 74 6f 20 6c 6f | 6f 6b 20 61 74 20 69 6e |re to lo|ok at in|
|00004750| 73 74 61 6e 63 65 73 20 | 6f 66 20 74 68 65 73 65 |stances |of these|
|00004760| 20 63 6c 61 73 73 65 73 | 20 28 73 65 65 20 46 69 | classes| (see Fi|
|00004770| 67 75 72 65 20 31 29 2c | 20 79 6f 75 20 77 6f 75 |gure 1),| you wou|
|00004780| 6c 64 20 00 06 00 02 00 | 00 00 a1 00 64 00 10 4f |ld .....|....d..O|
|00004790| 4e 4c 4e 00 64 04 13 01 | a7 01 a7 01 b3 01 f8 00 |NLN.d...|........|
|000047a0| 28 01 b0 01 a7 11 66 69 | 6e 64 20 74 68 61 74 20 |(.....fi|nd that |
|000047b0| 69 6e 20 65 61 63 68 00 | 06 00 00 00 00 00 a1 00 |in each.|........|
|000047c0| 64 00 10 4f 4e 4c 4e 00 | 64 04 25 01 b4 00 36 01 |d..ONLN.|d.%...6.|
|000047d0| c0 01 9e 00 28 01 bd 00 | 36 4e 63 61 73 65 20 74 |....(...|6Ncase t|
|000047e0| 68 65 20 69 6e 73 74 61 | 6e 63 65 20 73 74 6f 72 |he insta|nce stor|
|000047f0| 61 67 65 20 77 6f 75 6c | 64 20 63 6f 6e 74 61 69 |age woul|d contai|
|00004800| 6e 20 66 6f 75 72 20 62 | 79 74 65 73 20 66 6f 72 |n four b|ytes for|
|00004810| 20 74 68 65 20 43 2b 2b | 20 76 69 72 74 75 61 6c | the C++| virtual|
|00004820| 20 74 61 62 6c 65 20 28 | 00 00 03 00 16 00 a1 00 | table (|........|
|00004830| 64 00 10 4f 4e 4c 4e 00 | 64 04 73 01 b3 01 9e 01 |d..ONLN.|d.s.....|
|00004840| bf 01 c8 00 28 01 bd 01 | 9e 06 76 74 61 62 6c 65 |....(...|..vtable|
|00004850| 00 00 03 00 14 00 a1 00 | 64 00 10 4f 4e 4c 4e 00 |........|d..ONLN.|
|00004860| 64 04 79 01 b4 01 c8 01 | c0 01 cf 00 29 2a 02 29 |d.y.....|....)*.)|
|00004870| 20 00 06 00 01 00 00 00 | a1 00 64 00 10 4f 4e 4c | .......|..d..ONL|
|00004880| 4e 00 64 04 7b 01 b4 01 | cf 01 c0 01 f8 00 29 07 |N.d.{...|......).|
|00004890| 08 61 6e 64 20 66 6f 75 | 72 00 06 00 02 00 00 00 |.and fou|r.......|
|000048a0| a1 00 64 00 10 4f 4e 4c | 4e 00 64 04 84 01 c0 00 |..d..ONL|N.d.....|
|000048b0| 36 01 cc 01 62 00 28 01 | c9 00 36 3d 62 79 74 65 |6...b.(.|..6=byte|
|000048c0| 73 20 66 6f 72 20 74 68 | 65 20 69 6e 73 74 61 6e |s for th|e instan|
|000048d0| 63 65 20 76 61 72 69 61 | 62 6c 65 2e 20 20 41 6e |ce varia|ble. An|
|000048e0| 79 20 63 6f 64 65 20 74 | 68 61 74 20 61 63 63 65 |y code t|hat acce|
|000048f0| 73 73 65 73 20 74 68 65 | 20 00 06 00 03 00 00 00 |sses the| .......|
|00004900| a1 00 64 00 10 4f 4e 4c | 4e 00 64 04 c1 01 c0 01 |..d..ONL|N.d.....|
|00004910| 62 01 cc 01 f8 00 28 01 | c9 01 62 1e 69 6e 73 74 |b.....(.|..b.inst|
|00004920| 61 6e 63 65 20 76 61 72 | 69 61 62 6c 65 20 28 66 |ance var|iable (f|
|00004930| 6f 72 20 65 78 61 6d 70 | 6c 65 00 00 03 00 16 00 |or examp|le......|
|00004940| 06 00 00 00 00 00 a1 00 | 64 00 10 4f 4e 4c 4e 00 |........|d..ONLN.|
|00004950| 64 04 e0 01 cc 00 36 01 | d8 00 9f 00 28 01 d6 00 |d.....6.|....(...|
|00004960| 36 0f 54 42 61 73 65 42 | 3a 3a 53 65 74 56 61 72 |6.TBaseB|::SetVar|
|00004970| 42 00 03 00 14 00 a1 00 | 64 00 10 4f 4e 4c 4e 00 |B.......|d..ONLN.|
|00004980| 64 04 ef 01 cd 00 9f 01 | d9 00 c7 00 29 69 08 29 |d.......|....)i.)|
|00004990| 20 77 6f 75 6c 64 20 00 | 06 00 01 00 00 00 a1 00 | would .|........|
|000049a0| 64 00 10 4f 4e 4c 4e 00 | 64 04 f7 01 cd 00 c7 01 |d..ONLN.|d.......|
|000049b0| d9 01 f8 00 29 28 42 64 | 6f 20 73 6f 20 75 73 69 |....)(Bd|o so usi|
|000049c0| 6e 67 20 61 20 66 69 78 | 65 64 20 6f 66 66 73 65 |ng a fix|ed offse|
|000049d0| 74 20 66 72 6f 6d 20 74 | 68 65 20 73 74 61 72 74 |t from t|he start|
|000049e0| 20 6f 66 20 74 68 65 20 | 6f 62 6a 65 63 74 2e 20 | of the |object. |
|000049f0| 20 28 49 6e 20 74 68 69 | 73 00 06 00 00 00 00 00 | (In thi|s.......|
|00004a00| a1 00 64 00 10 4f 4e 4c | 4e 00 64 05 3a 01 d9 00 |..d..ONL|N.d.:...|
|00004a10| 36 01 e5 01 74 00 28 01 | e2 00 36 44 70 61 72 74 |6...t.(.|..6Dpart|
|00004a20| 69 63 75 6c 61 72 20 76 | 65 72 73 69 6f 6e 20 6f |icular v|ersion o|
|00004a30| 66 20 43 2b 2b 2c 20 74 | 68 69 73 20 6f 66 66 73 |f C++, t|his offs|
|00004a40| 65 74 20 77 61 73 20 30 | 3b 20 79 6f 75 72 20 6f |et was 0|; your o|
|00004a50| 66 66 73 65 74 20 6d 61 | 79 20 76 61 72 79 2e 29 |ffset ma|y vary.)|
|00004a60| 00 00 a0 00 82 00 01 00 | 0a 01 f1 00 85 02 22 01 |........|......".|
|00004a70| a9 00 09 00 00 00 00 00 | 00 00 00 00 31 01 f3 00 |........|....1...|
|00004a80| 87 02 0a 00 fc 00 07 00 | 02 00 02 00 09 ff ff ff |........|........|
|00004a90| ff ff ff ff ff 00 30 01 | f2 00 86 02 0b 00 fd 00 |......0.|........|
|00004aa0| a1 00 96 00 0c 01 00 00 | 00 02 00 00 00 00 00 00 |........|........|
|00004ab0| 00 00 a1 00 9a 00 08 ff | fc 00 00 00 13 00 00 00 |........|........|
|00004ac0| 01 00 0a 01 f7 00 ad 02 | 06 00 d6 00 03 00 16 00 |........|........|
|00004ad0| 0d 00 0e 00 10 09 61 53 | 44 09 61 53 44 00 a1 00 |......aS|D.aSD...|
|00004ae0| 64 00 10 4f 4e 4c 4e 00 | 64 ff ff 00 00 00 00 00 |d..ONLN.|d.......|
|00004af0| 00 00 00 00 2b 78 20 05 | 66 56 61 72 41 00 a0 00 |....+x .|fVarA...|
|00004b00| 97 00 01 00 0a 01 f1 00 | 85 02 22 01 a9 00 09 00 |........|..".....|
|00004b10| 00 00 00 00 00 00 00 00 | 31 02 0a 00 87 02 20 00 |........|1..... .|
|00004b20| fc 00 09 ff ff ff ff ff | ff ff ff 00 30 02 09 00 |........|....0...|
|00004b30| 86 02 21 00 fd 00 09 00 | 00 00 00 00 00 00 00 00 |..!.....|........|
|00004b40| 31 01 f3 01 32 02 0a 01 | a7 00 09 ff ff ff ff ff |1...2...|........|
|00004b50| ff ff ff 00 30 01 f2 01 | 31 02 0b 01 a8 00 09 00 |....0...|1.......|
|00004b60| 00 00 00 00 00 00 00 00 | 31 02 0a 01 32 02 20 01 |........|1...2. .|
|00004b70| a7 00 09 ff ff ff ff ff | ff ff ff 00 30 02 09 01 |........|....0...|
|00004b80| 31 02 21 01 a8 00 a1 00 | 96 00 0c 01 00 00 00 02 |1.!.....|........|
|00004b90| 00 00 00 00 00 00 00 00 | a1 00 9a 00 08 ff fc 00 |........|........|
|00004ba0| 00 00 1b 00 00 00 01 00 | 0a 02 0d 00 a5 02 1c 00 |........|........|
|00004bb0| de 00 a1 00 64 00 10 4f | 4e 4c 4e 00 64 ff ff 00 |....d..O|NLN.d...|
|00004bc0| 00 00 00 00 00 00 00 00 | 28 02 18 00 a6 07 76 74 |........|(.....vt|
|00004bd0| 61 62 6c 65 41 00 a0 00 | 97 00 a1 00 64 00 08 4d |ableA...|....d..M|
|00004be0| 44 50 4c 00 07 00 00 00 | 01 00 0a 01 f1 00 85 02 |DPL.....|........|
|00004bf0| 22 01 a9 00 09 00 00 00 | 00 00 00 00 00 00 31 01 |".......|......1.|
|00004c00| f7 01 58 02 06 01 81 00 | a1 00 96 00 0c 01 00 00 |..X.....|........|
|00004c10| 00 02 00 00 00 00 00 00 | 00 00 a1 00 9a 00 08 ff |........|........|
|00004c20| fc 00 00 00 13 00 00 00 | 01 00 0a 01 f7 01 58 02 |........|......X.|
|00004c30| 06 01 81 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 ff |......d.|.ONLN.d.|
|00004c40| ff 00 00 00 00 00 00 00 | 00 00 28 02 02 01 59 05 |........|..(...Y.|
|00004c50| 66 56 61 72 42 00 a0 00 | 97 00 a1 00 64 00 08 4d |fVarB...|....d..M|
|00004c60| 44 50 4c 00 08 00 00 00 | a1 00 64 00 08 4d 44 50 |DPL.....|..d..MDP|
|00004c70| 4c 00 07 00 00 00 01 00 | 0a 01 f1 00 85 02 22 01 |L.......|......".|
|00004c80| a9 00 31 02 0d 01 50 02 | 1c 01 89 00 a1 00 96 00 |..1...P.|........|
|00004c90| 0c 01 00 00 00 02 00 00 | 00 00 00 00 00 00 a1 00 |........|........|
|00004ca0| 9a 00 08 ff fc 00 00 00 | 1b 00 00 00 01 00 0a 02 |........|........|
|00004cb0| 0d 01 50 02 1c 01 89 00 | a1 00 64 00 10 4f 4e 4c |..P.....|..d..ONL|
|00004cc0| 4e 00 64 ff ff 00 00 00 | 00 00 00 00 00 00 28 02 |N.d.....|......(.|
|00004cd0| 18 01 51 07 76 74 61 62 | 6c 65 42 00 a0 00 97 00 |..Q.vtab|leB.....|
|00004ce0| a1 00 64 00 08 4d 44 50 | 4c 00 08 00 00 00 a0 00 |..d..MDP|L.......|
|00004cf0| 83 00 01 00 0a 00 00 00 | 00 03 48 02 52 00 03 00 |........|..H.R...|
|00004d00| 14 00 04 01 00 00 0d 00 | 0c 00 10 00 01 00 01 00 |........|........|
|00004d10| 01 00 01 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 05 |......d.|.ONLN.d.|
|00004d20| 7f 02 2e 00 87 02 3a 01 | a6 00 28 02 37 00 87 2e |......:.|..(.7...|
|00004d30| 46 69 67 75 72 65 20 31 | d0 4c 61 79 6f 75 74 20 |Figure 1|.Layout |
|00004d40| 6f 66 20 54 42 61 73 65 | 41 20 61 6e 64 20 54 42 |of TBase|A and TB|
|00004d50| 61 73 65 42 20 49 6e 73 | 74 61 6e 63 65 73 00 00 |aseB Ins|tances..|
|00004d60| 04 00 00 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 05 |......d.|.ONLN.d.|
|00004d70| ae 02 46 00 36 02 52 00 | f0 00 28 02 4f 00 36 25 |..F.6.R.|..(.O.6%|
|00004d80| 4e 6f 77 20 73 75 70 70 | 6f 73 65 20 79 6f 75 20 |Now supp|ose you |
|00004d90| 64 65 66 69 6e 65 20 61 | 6e 6f 74 68 65 72 20 63 |define a|nother c|
|00004da0| 6c 61 73 73 3a 00 03 00 | 16 00 0d 00 09 00 a1 00 |lass:...|........|
|00004db0| 64 00 10 4f 4e 4c 4e 00 | 64 05 d4 02 5e 00 36 02 |d..ONLN.|d...^.6.|
|00004dc0| 69 01 30 00 2a 17 32 20 | 20 20 20 63 6c 61 73 73 |i.0.*.2 | class|
|00004dd0| 20 54 44 65 72 69 76 65 | 64 3a 20 70 75 62 6c 69 | TDerive|d: publi|
|00004de0| 63 20 54 42 61 73 65 41 | 2c 20 70 75 62 6c 69 63 |c TBaseA|, public|
|00004df0| 20 54 42 61 73 65 42 20 | 7b 00 a1 00 64 00 10 4f | TBaseB |{...d..O|
|00004e00| 4e 4c 4e 00 64 06 07 02 | 68 00 36 02 73 00 6d 00 |NLN.d...|h.6.s.m.|
|00004e10| 2a 0a 0b 20 20 20 20 70 | 75 62 6c 69 63 3a 00 00 |*.. p|ublic:..|
|00004e20| a1 00 64 00 10 4f 4e 4c | 4e 00 64 06 13 02 72 00 |..d..ONL|N.d...r.|
|00004e30| 36 02 7d 01 35 00 2a 0a | 33 20 20 20 20 20 20 20 |6.}.5.*.|3 |
|00004e40| 20 76 69 72 74 75 61 6c | 20 76 6f 69 64 20 20 53 | virtual| void S|
|00004e50| 65 74 44 65 72 69 76 65 | 64 56 61 72 28 6c 6f 6e |etDerive|dVar(lon|
|00004e60| 67 20 6e 65 77 56 61 6c | 75 65 29 3b 00 00 a1 00 |g newVal|ue);....|
|00004e70| 64 00 10 4f 4e 4c 4e 00 | 64 06 47 02 7c 00 36 02 |d..ONLN.|d.G.|.6.|
|00004e80| 87 00 e0 00 2a 0a 22 20 | 20 20 20 20 20 20 20 20 |....*." | |
|00004e90| 20 20 20 20 20 20 20 6c | 6f 6e 67 20 20 66 44 65 | l|ong fDe|
|00004ea0| 72 69 76 65 64 56 61 72 | 3b 00 a1 00 64 00 10 4f |rivedVar|;...d..O|
|00004eb0| 4e 4c 4e 00 64 06 6a 02 | 86 00 36 02 91 00 63 00 |NLN.d.j.|..6...c.|
|00004ec0| 2a 0a 09 20 20 20 20 20 | 20 20 20 c9 00 00 a1 00 |*.. | .....|
|00004ed0| 64 00 10 4f 4e 4c 4e 00 | 64 06 74 02 90 00 36 02 |d..ONLN.|d.t...6.|
|00004ee0| 9b 00 54 00 2a 0a 06 20 | 20 20 20 7d 3b 00 07 00 |..T.*.. | };...|
|00004ef0| 01 00 01 00 09 ff ff ff | ff ff ff ff ff 00 20 02 |........|...... .|
|00004f00| bd 00 34 02 bd 01 f9 00 | 03 00 14 00 0d 00 0a 00 |..4.....|........|
|00004f10| 2a 3d 01 32 00 00 29 05 | 05 20 6f 66 20 35 00 00 |*=.2..).|. of 5..|
|00004f20| 29 fe 2e 50 54 20 32 38 | 20 2d 20 4d 75 6c 74 69 |)..PT 28| - Multi|
|00004f30| 70 6c 65 20 49 6e 68 65 | 72 69 74 61 6e 63 65 20 |ple Inhe|ritance |
|00004f40| 61 6e 64 20 48 61 6e 64 | 6c 65 4f 62 6a 65 63 74 |and Hand|leObject|
|00004f50| 73 00 2b 73 16 11 50 6c | 61 74 66 6f 72 6d 73 20 |s.+s..Pl|atforms |
|00004f60| 26 20 54 6f 6f 6c 73 00 | ff 18 c2 00 00 00 00 03 |& Tools.|........|
|00004f70| 48 02 52 00 11 02 ff 0c | 00 ff ff ff ff 00 00 00 |H.R.....|........|
|00004f80| 00 00 00 00 00 02 52 00 | 00 03 48 00 00 00 00 00 |......R.|..H.....|
|00004f90| 00 00 1e 00 01 00 0a 00 | 00 00 00 03 48 02 52 00 |........|....H.R.|
|00004fa0| 2c 00 08 00 14 05 54 69 | 6d 65 73 00 03 00 14 00 |,.....Ti|mes.....|
|00004fb0| 0d 00 0a 00 2e 00 04 00 | 00 00 00 00 2b 5a 2d 18 |........|....+Z-.|
|00004fc0| 44 65 76 65 6c 6f 70 65 | 72 20 53 75 70 70 6f 72 |Develope|r Suppor|
|00004fd0| 74 20 43 65 6e 74 65 72 | 00 00 28 00 2d 01 e8 0b |t Center|..(.-...|
|00004fe0| 41 75 67 75 73 74 20 31 | 39 39 30 00 20 00 2f 00 |August 1|990. ./.|
|00004ff0| 58 00 2f 02 1d 00 0d 00 | 0c 00 a1 00 64 00 10 4f |X./.....|....d..O|
|00005000| 4e 4c 4e 00 64 00 00 00 | 3d 00 5a 00 49 00 da 00 |NLN.d...|=.Z.I...|
|00005010| 28 00 46 00 5a 1d 49 6e | 20 74 68 69 73 20 63 61 |(.F.Z.In| this ca|
|00005020| 73 65 2c 20 61 6e 20 69 | 6e 73 74 61 6e 63 65 20 |se, an i|nstance |
|00005030| 6f 66 20 00 2c 00 0a 00 | 16 07 43 6f 75 72 69 65 |of .,...|..Courie|
|00005040| 72 00 03 00 16 00 a1 00 | 64 00 10 4f 4e 4c 4e 00 |r.......|d..ONLN.|
|00005050| 64 00 1d 00 3c 00 da 00 | 48 01 12 00 29 80 08 54 |d...<...|H...)..T|
|00005060| 44 65 72 69 76 65 64 00 | 03 00 14 00 a1 00 64 00 |Derived.|......d.|
|00005070| 10 4f 4e 4c 4e 00 64 00 | 25 00 3d 01 12 00 49 01 |.ONLN.d.|%.=...I.|
|00005080| 8a 00 29 38 1a 20 68 61 | 73 20 74 68 65 20 66 6f |..)8. ha|s the fo|
|00005090| 6c 6c 6f 77 69 6e 67 20 | 6c 61 79 6f 75 74 3a 00 |llowing |layout:.|
|000050a0| a0 00 82 00 a0 00 8c 00 | 01 00 0a 00 55 00 fd 00 |........|....U...|
|000050b0| cc 01 78 00 0a 00 00 00 | 00 00 00 00 00 00 34 00 |..x.....|......4.|
|000050c0| 58 01 01 00 6e 01 75 00 | 07 00 02 00 02 00 30 00 |X...n.u.|......0.|
|000050d0| 57 00 ff 00 70 01 76 00 | a1 00 96 00 06 02 00 00 |W...p.v.|........|
|000050e0| 00 02 20 00 a1 00 9a 00 | 08 ff fd 00 00 00 14 00 |.. .....|........|
|000050f0| 00 00 a0 00 98 00 03 00 | 16 00 0d 00 0e 00 10 00 |........|........|
|00005100| 77 00 7b 00 77 00 7b 00 | a1 00 64 00 10 4f 4e 4c |w.{.w.{.|..d..ONL|
|00005110| 4e 00 64 ff ff 00 00 00 | 00 00 00 00 00 00 2b 15 |N.d.....|......+.|
|00005120| 21 05 66 56 61 72 41 00 | a0 00 99 00 a0 00 97 00 |!.fVarA.|........|
|00005130| 34 00 70 01 01 00 84 01 | 74 00 30 00 6e 00 ff 00 |4.p.....|t.0.n...|
|00005140| 86 01 76 00 34 00 86 01 | 01 00 9b 01 74 00 30 00 |..v.4...|....t.0.|
|00005150| 84 00 ff 00 9d 01 76 00 | 34 00 9d 01 01 00 b1 01 |......v.|4.......|
|00005160| 74 00 30 00 9b 00 ff 00 | b3 01 76 00 34 00 b3 01 |t.0.....|..v.4...|
|00005170| 01 00 c8 01 74 00 30 00 | b1 00 ff 00 ca 01 76 00 |....t.0.|......v.|
|00005180| a1 00 96 00 06 02 00 00 | 00 02 20 00 a1 00 9a 00 |........|.. .....|
|00005190| 08 ff fd 00 00 00 34 00 | 00 00 a0 00 98 00 a1 00 |......4.|........|
|000051a0| 64 00 10 4f 4e 4c 4e 00 | 64 ff ff 00 00 00 00 00 |d..ONLN.|d.......|
|000051b0| 00 00 00 00 28 00 7d 01 | 07 0d 76 74 61 62 6c 65 |....(.}.|..vtable|
|000051c0| 44 65 72 69 76 65 64 00 | a0 00 99 00 a0 00 97 00 |Derived.|........|
|000051d0| a1 00 96 00 06 02 00 00 | 00 02 20 00 a1 00 9a 00 |........|.. .....|
|000051e0| 08 ff fd 00 00 00 2c 00 | 00 00 a0 00 98 00 a1 00 |......,.|........|
|000051f0| 64 00 10 4f 4e 4c 4e 00 | 64 ff ff 00 00 00 00 00 |d..ONLN.|d.......|
|00005200| 00 00 00 00 2b 08 44 0b | 66 44 65 72 69 76 65 64 |....+.D.|fDerived|
|00005210| 56 61 72 00 a0 00 99 00 | a0 00 97 00 34 00 8a 01 |Var.....|....4...|
|00005220| 27 00 97 01 4e 00 a1 00 | 96 00 06 02 00 00 00 02 |'...N...|........|
|00005230| 20 00 a1 00 9a 00 08 ff | fd 00 00 00 14 00 00 00 | .......|........|
|00005240| a0 00 98 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 ff |......d.|.ONLN.d.|
|00005250| ff 00 00 00 00 00 00 00 | 00 00 28 00 94 01 27 05 |........|..(...'.|
|00005260| 66 56 61 72 42 00 a0 00 | 99 00 a0 00 97 00 34 00 |fVarB...|......4.|
|00005270| a0 01 1f 00 ad 01 56 00 | a1 00 96 00 06 02 00 00 |......V.|........|
|00005280| 00 02 20 00 a1 00 9a 00 | 08 ff fd 00 00 00 1c 00 |.. .....|........|
|00005290| 00 00 a0 00 98 00 a1 00 | 64 00 10 4f 4e 4c 4e 00 |........|d..ONLN.|
|000052a0| 64 ff ff 00 00 00 00 00 | 00 00 00 00 28 00 aa 01 |d.......|....(...|
|000052b0| 1f 07 76 74 61 62 6c 65 | 42 00 a0 00 99 00 a0 00 |..vtable|B.......|
|000052c0| 97 00 a0 00 8d 00 a0 00 | 83 00 01 00 0a 00 00 00 |........|........|
|000052d0| 00 03 48 02 52 00 03 00 | 14 00 04 01 00 00 0d 00 |..H.R...|........|
|000052e0| 0c 00 10 00 01 00 01 00 | 01 00 01 00 a1 00 64 00 |........|......d.|
|000052f0| 10 4f 4e 4c 4e 00 64 00 | 40 00 d8 00 ce 00 e4 01 |.ONLN.d.|@.......|
|00005300| a7 00 28 00 e1 00 ce 24 | 46 69 67 75 72 65 20 32 |..(....$|Figure 2|
|00005310| d0 4c 61 79 6f 75 74 20 | 6f 66 20 54 44 65 72 69 |.Layout |of TDeri|
|00005320| 76 65 64 20 49 6e 73 74 | 61 6e 63 65 00 00 04 00 |ved Inst|ance....|
|00005330| 00 00 06 00 01 00 00 00 | a1 00 64 00 10 4f 4e 4c |........|..d..ONL|
|00005340| 4e 00 64 00 65 00 f1 00 | 5a 00 fd 00 fc 00 28 00 |N.d.e...|Z.....(.|
|00005350| fa 00 5a 20 54 68 69 73 | 20 69 73 20 77 68 61 74 |..Z This| is what|
|00005360| 20 79 6f 75 20 77 6f 75 | 6c 64 20 65 78 70 65 63 | you wou|ld expec|
|00005370| 74 2e 20 20 00 00 03 00 | 16 00 a1 00 64 00 10 4f |t. ....|....d..O|
|00005380| 4e 4c 4e 00 64 00 85 00 | f0 00 fc 00 fc 01 34 00 |NLN.d...|......4.|
|00005390| 29 a2 08 54 44 65 72 69 | 76 65 64 00 03 00 14 00 |)..TDeri|ved.....|
|000053a0| a1 00 64 00 10 4f 4e 4c | 4e 00 64 00 8d 00 f1 01 |..d..ONL|N.d.....|
|000053b0| 34 00 fd 01 93 00 29 38 | 14 20 69 6e 68 65 72 69 |4.....)8|. inheri|
|000053c0| 74 73 20 66 72 6f 6d 20 | 62 6f 74 68 20 00 03 00 |ts from |both ...|
|000053d0| 16 00 06 00 02 00 00 00 | a1 00 64 00 10 4f 4e 4c |........|..d..ONL|
|000053e0| 4e 00 64 00 a1 00 f0 01 | 93 00 fc 01 bd 00 29 5f |N.d.....|......)_|
|000053f0| 06 54 42 61 73 65 41 00 | 03 00 14 00 a1 00 64 00 |.TBaseA.|......d.|
|00005400| 10 4f 4e 4c 4e 00 64 00 | a7 00 f1 01 bd 00 fd 01 |.ONLN.d.|........|
|00005410| d8 00 29 2a 05 20 61 6e | 64 20 00 00 03 00 16 00 |..)*. an|d ......|
|00005420| a1 00 64 00 10 4f 4e 4c | 4e 00 64 00 ac 00 f0 01 |..d..ONL|N.d.....|
|00005430| d8 00 fc 02 02 00 29 1b | 06 54 42 61 73 65 42 00 |......).|.TBaseB.|
|00005440| 03 00 14 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 00 |......d.|.ONLN.d.|
|00005450| b2 00 f1 02 02 00 fd 02 | 1c 00 29 2a 05 2c 20 61 |........|..)*., a|
|00005460| 6e 64 00 00 06 00 00 00 | 00 00 a1 00 64 00 10 4f |nd......|....d..O|
|00005470| 4e 4c 4e 00 64 00 b8 00 | fe 00 5a 01 0a 00 c2 00 |NLN.d...|..Z.....|
|00005480| 28 01 07 00 5a 17 74 68 | 65 72 65 66 6f 72 65 20 |(...Z.th|erefore |
|00005490| 69 6e 73 74 61 6e 63 65 | 73 20 6f 66 20 00 03 00 |instance|s of ...|
|000054a0| 16 00 a1 00 64 00 10 4f | 4e 4c 4e 00 64 00 cf 00 |....d..O|NLN.d...|
|000054b0| fd 00 c2 01 09 00 fa 00 | 29 68 08 54 44 65 72 69 |........|)h.TDeri|
|000054c0| 76 65 64 00 03 00 14 00 | a1 00 64 00 10 4f 4e 4c |ved.....|..d..ONL|
|000054d0| 4e 00 64 00 d7 00 fe 00 | fa 01 0a 01 66 00 29 38 |N.d.....|....f.)8|
|000054e0| 1a 20 63 6f 6e 74 61 69 | 6e 20 61 20 70 61 72 74 |. contai|n a part|
|000054f0| 20 74 68 61 74 20 69 73 | 20 61 20 00 03 00 16 00 | that is| a .....|
|00005500| a1 00 64 00 10 4f 4e 4c | 4e 00 64 00 f1 00 fd 01 |..d..ONL|N.d.....|
|00005510| 66 01 09 01 90 00 29 6c | 06 54 42 61 73 65 41 00 |f.....)l|.TBaseA.|
|00005520| 03 00 14 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 00 |......d.|.ONLN.d.|
|00005530| f7 00 fe 01 90 01 0a 01 | c4 00 29 2a 0c 20 61 6e |........|..)*. an|
|00005540| 64 20 61 20 70 61 72 74 | 20 00 06 00 01 00 00 00 |d a part| .......|
|00005550| a1 00 64 00 10 4f 4e 4c | 4e 00 64 01 03 00 fe 01 |..d..ONL|N.d.....|
|00005560| c4 01 0a 01 ee 00 29 34 | 0a 74 68 61 74 20 69 73 |......)4|.that is|
|00005570| 20 61 20 00 03 00 16 00 | a1 00 64 00 10 4f 4e 4c | a .....|..d..ONL|
|00005580| 4e 00 64 01 0d 00 fd 01 | ee 01 09 02 18 00 29 2a |N.d.....|......)*|
|00005590| 06 54 42 61 73 65 42 00 | 03 00 14 00 a1 00 64 00 |.TBaseB.|......d.|
|000055a0| 10 4f 4e 4c 4e 00 64 01 | 13 00 fe 02 18 01 0a 02 |.ONLN.d.|........|
|000055b0| 1c 00 29 2a 01 2e 00 00 | 06 00 02 00 00 00 a1 00 |..)*....|........|
|000055c0| 64 00 10 4f 4e 4c 4e 00 | 64 01 16 01 0b 00 5a 01 |d..ONLN.|d.....Z.|
|000055d0| 17 00 e9 00 28 01 14 00 | 5a 1f 49 6e 20 61 64 64 |....(...|Z.In add|
|000055e0| 69 74 69 6f 6e 2c 20 74 | 68 65 20 76 69 72 74 75 |ition, t|he virtu|
|000055f0| 61 6c 20 74 61 62 6c 65 | 20 00 03 00 16 00 06 00 |al table| .......|
|00005600| 03 00 00 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 01 |......d.|.ONLN.d.|
|00005610| 35 01 0a 00 e9 01 16 01 | 44 00 29 8f 0d 76 74 61 |5.......|D.)..vta|
|00005620| 62 6c 65 44 65 72 69 76 | 65 64 00 00 03 00 14 00 |bleDeriv|ed......|
|00005630| a1 00 64 00 10 4f 4e 4c | 4e 00 64 01 42 01 0b 01 |..d..ONL|N.d.B...|
|00005640| 44 01 17 01 db 00 29 5b | 1e 20 69 6e 63 6c 75 64 |D.....)[|. includ|
|00005650| 65 73 20 74 68 65 20 74 | 61 62 6c 65 73 20 66 6f |es the t|ables fo|
|00005660| 72 20 62 6f 74 68 20 00 | 03 00 16 00 a1 00 64 00 |r both .|......d.|
|00005670| 10 4f 4e 4c 4e 00 64 01 | 60 01 0a 01 db 01 16 02 |.ONLN.d.|`.......|
|00005680| 05 00 29 97 06 54 42 61 | 73 65 41 00 03 00 14 00 |..)..TBa|seA.....|
|00005690| a1 00 64 00 10 4f 4e 4c | 4e 00 64 01 66 01 0b 02 |..d..ONL|N.d.f...|
|000056a0| 05 01 17 02 1c 00 29 2a | 04 20 61 6e 64 00 03 00 |......)*|. and...|
|000056b0| 16 00 06 00 00 00 00 00 | a1 00 64 00 10 4f 4e 4c |........|..d..ONL|
|000056c0| 4e 00 64 01 6b 01 17 00 | 5a 01 23 00 92 00 28 01 |N.d.k...|Z.#...(.|
|000056d0| 21 00 5a 08 54 44 65 72 | 69 76 65 64 00 00 03 00 |!.Z.TDer|ived....|
|000056e0| 14 00 a1 00 64 00 10 4f | 4e 4c 4e 00 64 01 73 01 |....d..O|NLN.d.s.|
|000056f0| 18 00 92 01 24 00 96 00 | 29 38 01 2e 00 00 03 00 |....$...|)8......|
|00005700| 16 00 a1 00 64 00 10 4f | 4e 4c 4e 00 64 01 75 01 |....d..O|NLN.d.u.|
|00005710| 30 00 5a 01 3c 00 92 00 | 28 01 3a 00 5a 08 54 44 |0.Z.<...|(.:.Z.TD|
|00005720| 65 72 69 76 65 64 00 00 | 03 00 14 00 a1 00 64 00 |erived..|......d.|
|00005730| 10 4f 4e 4c 4e 00 64 01 | 7d 01 31 00 92 01 3d 01 |.ONLN.d.|}.1...=.|
|00005740| 3f 00 29 38 26 20 61 6c | 73 6f 20 69 6e 68 65 72 |?.)8& al|so inher|
|00005750| 69 74 73 20 74 68 65 20 | 6d 65 74 68 6f 64 73 20 |its the |methods |
|00005760| 64 65 66 69 6e 65 64 20 | 69 6e 20 00 03 00 16 00 |defined |in .....|
|00005770| a1 00 64 00 10 4f 4e 4c | 4e 00 64 01 a3 01 30 01 |..d..ONL|N.d...0.|
|00005780| 3f 01 3c 01 69 00 29 ad | 06 54 42 61 73 65 41 00 |?.<.i.).|.TBaseA.|
|00005790| 03 00 14 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 01 |......d.|.ONLN.d.|
|000057a0| a9 01 31 01 69 01 3d 01 | 6c 00 29 2a 01 20 00 00 |..1.i.=.|l.)*. ..|
|000057b0| 06 00 01 00 00 00 a1 00 | 64 00 10 4f 4e 4c 4e 00 |........|d..ONLN.|
|000057c0| 64 01 aa 01 31 01 6c 01 | 3d 01 81 00 29 03 04 61 |d...1.l.|=...)..a|
|000057d0| 6e 64 20 00 03 00 16 00 | a1 00 64 00 10 4f 4e 4c |nd .....|..d..ONL|
|000057e0| 4e 00 64 01 ae 01 30 01 | 81 01 3c 01 ab 00 29 15 |N.d...0.|..<...).|
|000057f0| 06 54 42 61 73 65 42 00 | 03 00 14 00 a1 00 64 00 |.TBaseB.|......d.|
|00005800| 10 4f 4e 4c 4e 00 64 01 | b4 01 31 01 ab 01 3d 02 |.ONLN.d.|..1...=.|
|00005810| 1c 00 29 2a 15 2e 20 20 | 53 75 70 70 6f 73 65 20 |..)*.. |Suppose |
|00005820| 79 6f 75 20 77 61 6e 74 | 65 64 00 00 06 00 00 00 |you want|ed......|
|00005830| 00 00 a1 00 64 00 10 4f | 4e 4c 4e 00 64 01 ca 01 |....d..O|NLN.d...|
|00005840| 3e 00 5a 01 4a 00 b0 00 | 28 01 47 00 5a 13 74 6f |>.Z.J...|(.G.Z.to|
|00005850| 20 63 61 6c 6c 20 74 68 | 65 20 6d 65 74 68 6f 64 | call th|e method|
|00005860| 20 00 03 00 16 00 a1 00 | 64 00 10 4f 4e 4c 4e 00 | .......|d..ONLN.|
|00005870| 64 01 dd 01 3d 00 b0 01 | 49 00 e1 00 29 56 07 53 |d...=...|I...)V.S|
|00005880| 65 74 56 61 72 42 00 00 | 03 00 14 00 a1 00 64 00 |etVarB..|......d.|
|00005890| 10 4f 4e 4c 4e 00 64 01 | e4 01 3e 00 e1 01 4a 01 |.ONLN.d.|..>...J.|
|000058a0| 0d 00 29 31 0a 2c 20 75 | 73 69 6e 67 20 61 20 00 |..)1., u|sing a .|
|000058b0| 03 00 16 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 01 |......d.|.ONLN.d.|
|000058c0| ee 01 3d 01 0d 01 49 01 | 45 00 29 2c 08 54 44 65 |..=...I.|E.),.TDe|
|000058d0| 72 69 76 65 64 00 03 00 | 14 00 a1 00 64 00 10 4f |rived...|....d..O|
|000058e0| 4e 4c 4e 00 64 01 f6 01 | 3e 01 45 01 4a 01 9c 00 |NLN.d...|>.E.J...|
|000058f0| 29 38 13 20 6f 62 6a 65 | 63 74 2e 20 20 54 68 65 |)8. obje|ct. The|
|00005900| 20 63 6f 64 65 20 00 00 | 06 00 01 00 00 00 a1 00 | code ..|........|
|00005910| 64 00 10 4f 4e 4c 4e 00 | 64 02 09 01 3e 01 9c 01 |d..ONLN.|d...>...|
|00005920| 4a 01 ae 00 29 57 04 66 | 6f 72 20 00 03 00 16 00 |J...)W.f|or .....|
|00005930| a1 00 64 00 10 4f 4e 4c | 4e 00 64 02 0d 01 3d 01 |..d..ONL|N.d...=.|
|00005940| ae 01 49 01 df 00 29 12 | 07 53 65 74 56 61 72 42 |..I...).|.SetVarB|
|00005950| 00 00 03 00 14 00 a1 00 | 64 00 10 4f 4e 4c 4e 00 |........|d..ONLN.|
|00005960| 64 02 14 01 3e 01 df 01 | 4a 02 1c 00 29 31 0d 20 |d...>...|J...)1. |
|00005970| 69 73 20 65 78 70 65 63 | 74 69 6e 67 00 00 06 00 |is expec|ting....|
|00005980| 00 00 00 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 02 |......d.|.ONLN.d.|
|00005990| 22 01 4b 00 5a 01 57 00 | 9f 00 28 01 54 00 5a 0f |".K.Z.W.|..(.T.Z.|
|000059a0| 74 6f 20 62 65 20 70 61 | 73 73 65 64 20 61 20 00 |to be pa|ssed a .|
|000059b0| 06 00 01 00 00 00 a1 00 | 64 00 10 4f 4e 4c 4e 00 |........|d..ONLN.|
|000059c0| 64 02 31 01 4b 00 9f 01 | 57 00 da 00 29 45 0d 70 |d.1.K...|W...)E.p|
|000059d0| 6f 69 6e 74 65 72 20 74 | 6f 20 61 20 00 00 03 00 |ointer t|o a ....|
|000059e0| 16 00 a1 00 64 00 10 4f | 4e 4c 4e 00 64 02 3e 01 |....d..O|NLN.d.>.|
|000059f0| 4a 00 da 01 56 01 04 00 | 29 3b 06 54 42 61 73 65 |J...V...|);.TBase|
|00005a00| 42 00 03 00 14 00 a1 00 | 64 00 10 4f 4e 4c 4e 00 |B.......|d..ONLN.|
|00005a10| 64 02 44 01 4b 01 04 01 | 57 02 1c 00 29 2a 3b 20 |d.D.K...|W...)*; |
|00005a20| 6f 62 6a 65 63 74 20 28 | 61 6c 6c 20 6d 65 74 68 |object (|all meth|
|00005a30| 6f 64 73 20 61 72 65 20 | 70 61 73 73 65 64 20 61 |ods are |passed a|
|00005a40| 20 70 6f 69 6e 74 65 72 | 20 74 6f 20 61 6e 20 61 | pointer| to an a|
|00005a50| 70 70 72 6f 70 72 69 61 | 74 65 00 00 06 00 02 00 |ppropria|te......|
|00005a60| 00 00 a1 00 64 00 10 4f | 4e 4c 4e 00 64 02 80 01 |....d..O|NLN.d...|
|00005a70| 58 00 5a 01 64 01 41 00 | 28 01 61 00 5a 30 6f 62 |X.Z.d.A.|(.a.Z0ob|
|00005a80| 6a 65 63 74 20 61 73 20 | 61 6e 20 69 6d 70 6c 69 |ject as |an impli|
|00005a90| 63 69 74 20 70 61 72 61 | 6d 65 74 65 72 29 2c 20 |cit para|meter), |
|00005aa0| 61 6e 64 20 72 65 66 65 | 72 73 20 74 6f 20 00 00 |and refe|rs to ..|
|00005ab0| 03 00 16 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 02 |......d.|.ONLN.d.|
|00005ac0| b0 01 57 01 41 01 63 01 | 64 00 29 e7 05 66 56 61 |..W.A.c.|d.)..fVa|
|00005ad0| 72 42 00 00 03 00 14 00 | a1 00 64 00 10 4f 4e 4c |rB......|..d..ONL|
|00005ae0| 4e 00 64 02 b5 01 58 01 | 64 01 64 01 84 00 29 23 |N.d...X.|d.d...)#|
|00005af0| 06 20 62 79 20 61 20 00 | 06 00 03 00 00 00 a1 00 |. by a .|........|
|00005b00| 64 00 10 4f 4e 4c 4e 00 | 64 02 bb 01 58 01 84 01 |d..ONLN.|d...X...|
|00005b10| 64 02 1c 00 29 20 1f 66 | 69 78 65 64 20 6f 66 66 |d...) .f|ixed off|
|00005b20| 73 65 74 20 66 72 6f 6d | 20 74 68 61 74 20 70 6f |set from| that po|
|00005b30| 69 6e 74 65 72 2e 00 00 | 06 00 00 00 00 00 a1 00 |inter...|........|
|00005b40| 64 00 10 4f 4e 4c 4e 00 | 64 02 dc 01 65 00 5a 01 |d..ONLN.|d...e.Z.|
|00005b50| 71 00 ae 00 28 01 6e 00 | 5a 13 54 68 65 72 65 66 |q...(.n.|Z.Theref|
|00005b60| 6f 72 65 2c 20 74 6f 20 | 63 61 6c 6c 20 00 03 00 |ore, to |call ...|
|00005b70| 16 00 a1 00 64 00 10 4f | 4e 4c 4e 00 64 02 ef 01 |....d..O|NLN.d...|
|00005b80| 64 00 ae 01 70 00 df 00 | 29 54 07 53 65 74 56 61 |d...p...|)T.SetVa|
|00005b90| 72 42 00 00 03 00 14 00 | a1 00 64 00 10 4f 4e 4c |rB......|..d..ONL|
|00005ba0| 4e 00 64 02 f6 01 65 00 | df 01 71 01 07 00 29 31 |N.d...e.|..q...)1|
|00005bb0| 09 20 75 73 69 6e 67 20 | 61 20 00 00 03 00 16 00 |. using |a ......|
|00005bc0| a1 00 64 00 10 4f 4e 4c | 4e 00 64 02 ff 01 64 01 |..d..ONL|N.d...d.|
|00005bd0| 07 01 70 01 3f 00 29 28 | 08 54 44 65 72 69 76 65 |..p.?.)(|.TDerive|
|00005be0| 64 00 03 00 14 00 a1 00 | 64 00 10 4f 4e 4c 4e 00 |d.......|d..ONLN.|
|00005bf0| 64 03 07 01 65 01 3f 01 | 71 01 7e 00 29 38 0d 20 |d...e.?.|q.~.)8. |
|00005c00| 6f 62 6a 65 63 74 2c 20 | 43 2b 2b 20 00 00 06 00 |object, |C++ ....|
|00005c10| 01 00 00 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 03 |......d.|.ONLN.d.|
|00005c20| 14 01 65 01 7e 01 71 02 | 1c 00 29 3f 21 70 61 73 |..e.~.q.|..)?!pas|
|00005c30| 73 65 73 20 61 20 70 6f | 69 6e 74 65 72 20 74 6f |ses a po|inter to|
|00005c40| 20 74 68 65 20 6d 69 64 | 64 6c 65 20 6f 66 00 00 | the mid|dle of..|
|00005c50| 06 00 00 00 00 00 a1 00 | 64 00 10 4f 4e 4c 4e 00 |........|d..ONLN.|
|00005c60| 64 03 36 01 72 00 5a 01 | 7e 01 da 00 28 01 7b 00 |d.6.r.Z.|~...(.{.|
|00005c70| 5a 59 74 68 65 20 6f 62 | 6a 65 63 74 3b 20 73 70 |ZYthe ob|ject; sp|
|00005c80| 65 63 69 66 69 63 61 6c | 6c 79 20 69 74 20 70 61 |ecifical|ly it pa|
|00005c90| 73 73 65 73 20 61 20 70 | 6f 69 6e 74 65 72 20 74 |sses a p|ointer t|
|00005ca0| 6f 20 74 68 65 20 70 61 | 72 74 20 6f 66 20 74 68 |o the pa|rt of th|
|00005cb0| 65 20 6f 62 6a 65 63 74 | 20 74 68 61 74 20 72 65 |e object| that re|
|00005cc0| 70 72 65 73 65 6e 74 73 | 20 61 20 00 03 00 16 00 |presents| a .....|
|00005cd0| a1 00 64 00 10 4f 4e 4c | 4e 00 64 03 8f 01 71 01 |..d..ONL|N.d...q.|
|00005ce0| da 01 7d 02 04 00 28 01 | 7b 01 da 06 54 42 61 73 |..}...(.|{...TBas|
|00005cf0| 65 42 00 00 03 00 14 00 | a1 00 64 00 10 4f 4e 4c |eB......|..d..ONL|
|00005d00| 4e 00 64 03 95 01 72 02 | 04 01 7e 02 08 00 29 2a |N.d...r.|..~...)*|
|00005d10| 01 2e 00 00 06 00 02 00 | 00 00 a1 00 64 00 10 4f |........|....d..O|
|00005d20| 4e 4c 4e 00 64 03 97 01 | 8a 00 5a 01 96 01 ed 00 |NLN.d...|..Z.....|
|00005d30| 28 01 93 00 5a 4e 54 68 | 69 73 20 67 69 76 65 73 |(...ZNTh|is gives|
|00005d40| 20 79 6f 75 20 61 20 76 | 65 72 79 20 62 61 73 69 | you a v|ery basi|
|00005d50| 63 20 69 64 65 61 20 6f | 66 20 68 6f 77 20 43 2b |c idea o|f how C+|
|00005d60| 2b 20 69 6d 70 6c 65 6d | 65 6e 74 73 20 6d 75 6c |+ implem|ents mul|
|00005d70| 74 69 70 6c 65 20 69 6e | 68 65 72 69 74 61 6e 63 |tiple in|heritanc|
|00005d80| 65 2e 20 20 00 00 06 00 | 03 00 00 00 a1 00 64 00 |e. ....|......d.|
|00005d90| 10 4f 4e 4c 4e 00 64 03 | e5 01 8a 01 ed 01 96 02 |.ONLN.d.|........|
|00005da0| 1c 00 28 01 93 01 ed 08 | 46 6f 72 20 6d 6f 72 65 |..(.....|For more|
|00005db0| 00 00 06 00 02 00 00 00 | a1 00 64 00 10 4f 4e 4c |........|..d..ONL|
|00005dc0| 4e 00 64 03 ee 01 96 00 | 5a 01 a2 00 81 00 28 01 |N.d.....|Z.....(.|
|00005dd0| 9f 00 5a 09 64 65 74 61 | 69 6c 73 2c 20 00 06 00 |..Z.deta|ils, ...|
|00005de0| 03 00 00 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 03 |......d.|.ONLN.d.|
|00005df0| f7 01 96 00 81 01 a2 01 | ba 00 29 27 3c 72 65 61 |........|..)'<rea|
|00005e00| 64 20 d2 4d 75 6c 74 69 | 70 6c 65 20 49 6e 68 65 |d .Multi|ple Inhe|
|00005e10| 72 69 74 61 6e 63 65 20 | 66 6f 72 20 43 2b 2b d3 |ritance |for C++.|
|00005e20| 20 62 79 20 42 6a 61 72 | 6e 65 20 53 74 72 6f 75 | by Bjar|ne Strou|
|00005e30| 73 74 72 75 70 20 69 6e | 20 00 04 02 00 00 a1 00 |strup in| .......|
|00005e40| 64 00 10 4f 4e 4c 4e 00 | 64 04 33 01 96 01 ba 01 |d..ONLN.|d.3.....|
|00005e50| a2 02 1c 00 28 01 9f 01 | ba 10 50 72 6f 63 65 65 |....(...|..Procee|
|00005e60| 64 69 6e 67 73 20 45 55 | 55 47 00 00 06 00 00 00 |dings EU|UG......|
|00005e70| 00 00 a1 00 64 00 10 4f | 4e 4c 4e 00 64 04 44 01 |....d..O|NLN.d.D.|
|00005e80| a2 00 5a 01 ae 00 ce 00 | 28 01 ab 00 5a 16 53 70 |..Z.....|(...Z.Sp|
|00005e90| 72 69 6e 67 20 31 39 38 | 37 20 43 6f 6e 66 65 72 |ring 198|7 Confer|
|00005ea0| 65 6e 63 65 00 00 04 00 | 00 00 a1 00 64 00 10 4f |ence....|....d..O|
|00005eb0| 4e 4c 4e 00 64 04 5a 01 | a2 00 ce 01 ae 01 01 00 |NLN.d.Z.|........|
|00005ec0| 29 74 0b 2c 20 48 65 6c | 73 69 6e 6b 69 2e 00 00 |)t., Hel|sinki...|
|00005ed0| 04 01 00 00 0d 00 0e 00 | a1 00 64 00 10 4f 4e 4c |........|..d..ONL|
|00005ee0| 4e 00 64 04 66 01 c6 00 | 5a 01 d5 01 28 00 28 01 |N.d.f...|Z...(.(.|
|00005ef0| d2 00 5a 1c 53 6f 20 57 | 68 61 74 20 41 62 6f 75 |..Z.So W|hat Abou|
|00005f00| 74 20 48 61 6e 64 6c 65 | 4f 62 6a 65 63 74 73 3f |t Handle|Objects?|
|00005f10| 00 00 04 00 00 00 0d 00 | 0c 00 06 00 01 00 00 00 |........|........|
|00005f20| a1 00 64 00 10 4f 4e 4c | 4e 00 64 04 83 01 e2 00 |..d..ONL|N.d.....|
|00005f30| 5a 01 ee 00 88 00 2a 19 | 09 54 68 65 20 6e 65 78 |Z.....*.|.The nex|
|00005f40| 74 20 00 00 06 00 02 00 | 00 00 a1 00 64 00 10 4f |t ......|....d..O|
|00005f50| 4e 4c 4e 00 64 04 8c 01 | e2 00 88 01 ee 01 c4 00 |NLN.d...|........|
|00005f60| 29 2e 3f 71 75 65 73 74 | 69 6f 6e 20 69 73 20 68 |).?quest|ion is h|
|00005f70| 6f 77 20 74 68 69 73 20 | 69 6d 70 6c 65 6d 65 6e |ow this |implemen|
|00005f80| 74 61 74 69 6f 6e 20 69 | 6d 70 6f 73 65 73 20 61 |tation i|mposes a|
|00005f90| 20 72 65 73 74 72 69 63 | 74 69 6f 6e 20 6f 6e 20 | restric|tion on |
|00005fa0| 61 20 00 00 03 00 16 00 | a1 00 64 00 10 4f 4e 4c |a ......|..d..ONL|
|00005fb0| 4e 00 64 04 cb 01 e1 01 | c4 01 ed 02 18 00 28 01 |N.d.....|......(.|
|00005fc0| eb 01 c4 0c 48 61 6e 64 | 6c 65 4f 62 6a 65 63 74 |....Hand|leObject|
|00005fd0| 00 00 03 00 14 00 a1 00 | 64 00 10 4f 4e 4c 4e 00 |........|d..ONLN.|
|00005fe0| 64 04 d7 01 e2 02 18 01 | ee 02 1c 00 29 54 01 2e |d.......|....)T..|
|00005ff0| 00 00 06 00 00 00 00 00 | a1 00 64 00 10 4f 4e 4c |........|..d..ONL|
|00006000| 4e 00 64 04 da 01 ef 00 | 5a 01 fb 01 1d 00 28 01 |N.d.....|Z.....(.|
|00006010| f8 00 5a 28 54 68 65 20 | 61 6e 73 77 65 72 20 69 |..Z(The |answer i|
|00006020| 73 20 73 69 6d 70 6c 65 | 2e 20 20 45 61 63 68 20 |s simple|. Each |
|00006030| 6d 65 74 68 6f 64 20 6f | 66 20 61 20 00 00 03 00 |method o|f a ....|
|00006040| 16 00 a1 00 64 00 10 4f | 4e 4c 4e 00 64 05 02 01 |....d..O|NLN.d...|
|00006050| ee 01 1d 01 fa 01 71 00 | 29 c3 0c 48 61 6e 64 6c |......q.|)..Handl|
|00006060| 65 4f 62 6a 65 63 74 00 | 03 00 14 00 a1 00 64 00 |eObject.|......d.|
|00006070| 10 4f 4e 4c 4e 00 64 05 | 0e 01 ef 01 71 01 fb 01 |.ONLN.d.|....q...|
|00006080| b4 00 29 54 0f 20 63 6c | 61 73 73 20 65 78 70 65 |..)T. cl|ass expe|
|00006090| 63 74 73 20 00 00 06 00 | 01 00 00 00 a1 00 64 00 |cts ....|......d.|
|000060a0| 10 4f 4e 4c 4e 00 64 05 | 1d 01 ef 01 b4 01 fb 02 |.ONLN.d.|........|
|000060b0| 1c 00 29 43 15 74 6f 20 | 62 65 20 70 61 73 73 65 |..)C.to |be passe|
|000060c0| 64 20 61 20 68 61 6e 64 | 6c 65 00 00 06 00 02 00 |d a hand|le......|
|000060d0| 00 00 a1 00 64 00 10 4f | 4e 4c 4e 00 64 05 33 01 |....d..O|NLN.d.3.|
|000060e0| fb 00 5a 02 07 00 68 00 | 28 02 04 00 5a 03 74 6f |..Z...h.|(...Z.to|
|000060f0| 20 00 06 00 03 00 00 00 | a1 00 64 00 10 4f 4e 4c | .......|..d..ONL|
|00006100| 4e 00 64 05 36 01 fb 00 | 68 02 07 02 1c 00 29 0e |N.d.6...|h.....).|
|00006110| 56 74 68 65 20 6f 62 6a | 65 63 74 2c 20 69 6e 73 |Vthe obj|ect, ins|
|00006120| 74 65 61 64 20 6f 66 20 | 61 20 70 6f 69 6e 74 65 |tead of |a pointe|
|00006130| 72 2e 20 20 42 75 74 20 | 77 68 65 6e 20 6d 75 6c |r. But |when mul|
|00006140| 74 69 70 6c 65 20 69 6e | 68 65 72 69 74 61 6e 63 |tiple in|heritanc|
|00006150| 65 20 69 73 20 75 73 65 | 64 2c 20 74 68 65 20 63 |e is use|d, the c|
|00006160| 6f 6d 70 69 6c 65 72 00 | 06 00 00 00 00 00 a1 00 |ompiler.|........|
|00006170| 64 00 10 4f 4e 4c 4e 00 | 64 05 8d 02 07 00 5a 02 |d..ONLN.|d.....Z.|
|00006180| 13 01 0f 00 28 02 10 00 | 5a 27 73 6f 6d 65 74 69 |....(...|Z'someti|
|00006190| 6d 65 73 20 68 61 73 20 | 74 6f 20 70 61 73 73 20 |mes has |to pass |
|000061a0| 61 20 70 6f 69 6e 74 65 | 72 20 74 6f 20 74 68 65 |a pointe|r to the|
|000061b0| 20 00 06 00 01 00 00 00 | a1 00 64 00 10 4f 4e 4c | .......|..d..ONL|
|000061c0| 4e 00 64 05 b4 02 07 01 | 0f 02 13 02 1c 00 29 b5 |N.d.....|......).|
|000061d0| 3b 6d 69 64 64 6c 65 20 | 6f 66 20 74 68 65 20 6f |;middle |of the o|
|000061e0| 62 6a 65 63 74 2e 20 20 | 49 74 20 69 73 20 6e 6f |bject. |It is no|
|000061f0| 74 20 70 6f 73 73 69 62 | 6c 65 20 74 6f 20 63 72 |t possib|le to cr|
|00006200| 65 61 74 65 20 61 20 76 | 61 6c 69 64 00 00 a1 00 |eate a v|alid....|
|00006210| 64 00 10 4f 4e 4c 4e 00 | 64 05 f0 02 13 00 5a 02 |d..ONLN.|d.....Z.|
|00006220| 1f 01 c8 00 28 02 1c 00 | 5a 4d 68 61 6e 64 6c 65 |....(...|ZMhandle|
|00006230| 20 74 68 61 74 20 72 65 | 66 65 72 73 20 74 6f 20 | that re|fers to |
|00006240| 74 68 65 20 6d 69 64 64 | 6c 65 20 6f 66 20 61 6e |the midd|le of an|
|00006250| 6f 74 68 65 72 20 68 61 | 6e 64 6c 65 2e 20 20 28 |other ha|ndle. (|
|00006260| 43 72 65 61 74 69 6e 67 | 20 61 20 66 61 6b 65 20 |Creating| a fake |
|00006270| 68 61 6e 64 6c 65 20 00 | 06 00 02 00 00 00 a1 00 |handle .|........|
|00006280| 64 00 10 4f 4e 4c 4e 00 | 64 06 3d 02 13 01 c8 02 |d..ONLN.|d.=.....|
|00006290| 1f 02 1c 00 28 02 1c 01 | c8 12 69 73 20 61 20 63 |....(...|..is a c|
|000062a0| 6f 6d 70 61 74 69 62 69 | 6c 69 74 79 00 00 06 00 |ompatibi|lity....|
|000062b0| 00 00 00 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 06 |......d.|.ONLN.d.|
|000062c0| 50 02 1f 00 5a 02 2b 02 | 1c 00 28 02 28 00 5a 62 |P...Z.+.|..(.(.Zb|
|000062d0| 72 69 73 6b 3b 20 62 65 | 73 69 64 65 73 2c 20 74 |risk; be|sides, t|
|000062e0| 68 65 20 70 6f 69 6e 74 | 65 72 20 69 6e 74 6f 20 |he point|er into |
|000062f0| 74 68 65 20 6d 69 64 64 | 6c 65 20 6f 66 20 74 68 |the midd|le of th|
|00006300| 65 20 68 61 6e 64 6c 65 | 20 77 6f 75 6c 64 20 62 |e handle| would b|
|00006310| 65 20 69 6e 76 61 6c 69 | 64 20 69 66 20 74 68 65 |e invali|d if the|
|00006320| 20 68 61 6e 64 6c 65 20 | 69 73 20 6d 6f 76 65 64 | handle |is moved|
|00006330| 2e 29 00 00 06 00 06 00 | 00 00 a1 00 64 00 10 4f |.)......|....d..O|
|00006340| 4e 4c 4e 00 64 06 b3 02 | 37 00 5a 02 43 01 51 00 |NLN.d...|7.Z.C.Q.|
|00006350| 2a 18 2b 44 65 73 69 67 | 6e 69 6e 67 20 61 20 6e |*.+Desig|ning a n|
|00006360| 65 77 20 69 6d 70 6c 65 | 6d 65 6e 74 61 74 69 6f |ew imple|mentatio|
|00006370| 6e 20 6f 66 20 6d 75 6c | 74 69 70 6c 65 20 00 00 |n of mul|tiple ..|
|00006380| 06 00 07 00 00 00 a1 00 | 64 00 10 4f 4e 4c 4e 00 |........|d..ONLN.|
|00006390| 64 06 de 02 37 01 51 02 | 43 02 1c 00 29 f7 25 69 |d...7.Q.|C...).%i|
|000063a0| 6e 68 65 72 69 74 61 6e | 63 65 20 74 68 61 74 20 |nheritan|ce that |
|000063b0| 69 73 20 63 6f 6d 70 61 | 74 69 62 6c 65 20 77 69 |is compa|tible wi|
|000063c0| 74 68 20 61 00 00 03 00 | 16 00 06 00 01 00 00 00 |th a....|........|
|000063d0| a1 00 64 00 10 4f 4e 4c | 4e 00 64 07 04 02 43 00 |..d..ONL|N.d...C.|
|000063e0| 5a 02 4f 00 ae 00 28 02 | 4d 00 5a 0c 48 61 6e 64 |Z.O...(.|M.Z.Hand|
|000063f0| 6c 65 4f 62 6a 65 63 74 | 00 00 03 00 14 00 a1 00 |leObject|........|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.